On Sat, Apr 9, 2011 at 01:39, hgc2002 <[email protected]> wrote:
> OK, fair to avoid such long discussion again and make it llittle bit mode
> educative, but also just to summary the available options to
> overload/workaround the Mixin loading:
>
> .- Using qx.Class.include() can "force" the Mixin to be loaded at that
> point
> and not at the end of the current order ?
>
- Mixins are normally included in either of two ways: by an "include:"
member of the class configuration, or by explicitly calling
qx.Class.include().
- If the mixin contains a constructor, then instantiating an object of a
class which has been mixed with that mixin will have the class' own
constructor called first, and the mixin's constructor called after
completion of the class' own constructor.
- A class does not necessarily know that it has been altered by a mixin
(e.g., if qx.Class.include() is used) and can make no assumptions about what
a mixin might do.
- A class knows that it has the capabilities of a mixin only if the mixin
is included with the include: member of the class configuration.
Use of mixins is very powerful. It can be used to better organize code... or
it can be used to totally screw up the operation of a class (as you
discovered). :-) Knowing the order in which the constructors are called
helps you to avoid problems.
> .- Use a defer:
>
> defer: function(statics,members,properties){
> members.setContextMenuHandler(0,members.__handler);
> }
>
> .- Use a timer:
>
> qx.util.TimerManager.getInstance().start(
> function(userData, timerId)
> 0, this, null, 1);
> }
>
These are workarounds for particular issues which are likely better solved
in different ways. They are very issue-dependent, so don't really apply to
the general discussion.
Cheers,
Derrell
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel