On Wed, Jun 9, 2010 at 05:18, Peter Schneider <[email protected]>wrote:
> Hello,
>
> it seems to me, that currently (qooxdoo 1.2-pre) it is not possible to
> patch
> static methods with the qx.Class.patch(...) call.
> Only the events, properties and members from the provided Mixin (2nd
> parameter)
> will be patched into/over the "to be patched" class as far as I can see.
> Is there any reason for this?
> If yes, can someone give me that reason ;)
> If no, I would like to be able to patch statics as well and would therefore
> create a bug/enhancement-entry for this.
>
Peter, static members remain with their class, always named according to
their original class name. If class A has a static method called myMethod,
you can access that method cas A.myMethod() regardless of subclassing. If
class B extends A, it can define its own static method myMethod that is then
accessible as B.myMethod. There is no overriding of statics. If there were,
they wouldn't be static. :-)
Note, also, that if B does not have its own myMethod, then an instance of B
must still access A's static myMethod using A.myMethod.
I hope that explains why you can't patch them.
Derrell
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel