Thanks Derrell!

The same thoughts came to my mind shortly after posting my question.
I completely agree with your arguments.

My looking at "patch" was more like the UNIX/Linux "patch" tool ;)

So the (only?) difference between qx.Class.include() and qx.Class.patch() is
their ability to overwrite already available members/events/properties, right?!

Nevertheless, thanks again for the explanations. I hope I remember them the
next time I try to "*nix-patch" framework classes :-D

Issue solved!
  Peter


On 2010-06-09 15:47 Derrell Lipman wrote:
> 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

Reply via email to