> Hi. > > Just my opinion: mixins are sort of like partial base classes. > IMO it's only reasonable that their constructor is called before the > constructor of the containing/inheriting class. In case you need a > mixin that has to rely on features of the including class, you can use > template method in the base class'es constructor. But in such a case a > mixin is IMO improperly used. > > Semantically, mixins are there to add generic functionality to various > classes, not to change/augment classes in ways of which the classes are > not aware - this is what AOP is for, not mixins. Therefore, mixins > shouldn't rely on the class including them, whereas the including class > can legitimately rely on implementation of the included mixins. > For this to always work, mixin parts of an object should be initialized > before the part corresponding to the actual class.
I agree (100%, no wonder ;) ) Nevertheless I don't think this "wrong" behavior can be fixed easily in the qooxdoo framework. Some (many) parts might rely on this. Even if the framework occurrences can be found and fixed there might be some applications out there that do the same :( >From my point of view the first thing that has to be done is to document clearly the constructor-call sequence (base-class,class,mixin(s)). I think the sequence in which constructors from multiple mixins are called will depend on their appearance in the "include : []" array. If the sequence can be swapped easily (framework-fix), I would welcome this very much! (A migration-script could drop a note on mixin-usage for application developers on this) /Peter > > br, > > flj > >[...] ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
