On 08/25/2011 01:54 PM, Gian Marco Gherardi wrote:
> I think that mixing a class to use mixin's method only internally is 
> not the correct use. I've chenged the class using directly 
> a qx.ui.core.Blocker instance:
>

Great. - I still think you raised a valid question: How can I use mixin 
features in my class' constructor?

First off, there is nothing generally wrong with using mixin features in 
the including class' constructor. But you were right, class constructors 
run *before* their mixin constructors. And in the case of 
qx.ui.core.MBlocker, this mixin's apply methods require that the mixin 
constructor has run. Other mixins could be different, but I guess this 
is not unusual.

So you have to actually inspect the concrete mixin you want to work with 
if you plan to use mixin features in your class' constructor. As for 
this order, class constructor before mixin constructor, I faintly 
remember discussions where it became apparent that this order would make 
sense (e.g. for the mixin to tweak things on the main class). 
Apparently, there seem to be use cases for the other way round as well 
:). If you feel strong about it, open an enhancement bug for it.

For the time being there is an, albeit crude, workaround to achieve what 
you initially wanted. Create a second class as a child class of your 
first. Have the parent class include the mixin, but call the mixin 
setter in the child class after calling this.base(arguments). This 
assures that the mixin constructor has been run.

T.



------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to