On Mon, Mar 22, 2010 at 10:04, Pascal Chorus <[email protected]>wrote:

>  Hi all,
>
> I detected a problem when defining a class hierarchy containing an
> interface and multiple abstract classes.
> In the attachment, you find the sourcecode referring to what I am
> describing here.
>
> I defined the following hierarchy:
>
> Inter             qx.Interface
>
> Abstr            qx.Class, type: "abstract"
>
> Abstr2          qx.Class, type: "abstract"
>
> Konkr           qx.Class, concrete class
>
>
> In the interface "Inter", the function f1 is declared. "Abstr" and "Abstr2"
> do not implement the function, only "Konkr" does.
> When instantiating an object of class "Konkr", firebug reports the
> following error:
>
> *Implementation of method "f1" is missing in class "Abstr2" required by
> interface "Inter".*
>
> f1 is indeed missing in "Abstr2", but in my opinion, this should not be a
> problem, since "Abstr2" is abstract anyway.
> Furthermore, an object of type "Konkr" is created and "Konkr" has an
> implementation of "f1".
>

I don't have a strong opinion one way or another on this. It does seem that
if you're going to say that something implements an interface, then it
should implement the requirements of that interface. I can see the argument
about abstract, though.

Elsewhere where we have methods that must be implemented by the extending
concrete class, we do something like this in the abstract subclass:

     someMethod : function()
    {
      throw new Error("someMethod is abstract");
    },

The concrete class will then override someMethod() with a real
implementatioan of the method.

Derrell
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to