Gaetan de Menten wrote:
>
>> Does anybody know if there is a better way than:
>> var statics = qx.Class.getByName(this.classname)
>> to access the static members/class variables of the "current" (most
>> specialized) class from one of its parent class?
>
Static variables should be typically accessed through the full namespace
(i.e., myAppNamespace.myClass.myStaticVar): «Accessing those class members
involves the fully-qualified class name» [1].
Note: if you have lots of access to a static variable (for example, in a
'for' loop), this may become slow in Internet Explorer 6 [2]. So, in that
circumstance, I recommend creating a cache variable in that code region:
var classRef = myAppNamespace.myClass;
for(var i = 0; i < 1000; i++){
// do something with classRef.myStaticVar
}
Although only recommended for this sort of case, I'd also like to have some
feedback on this specific tweak: this is not, AFAIK, part of any advised
practice (at least, up until now). If this is interesting, it may be put in
qooxdoo class documentation.
Helder Magalhães
[1] http://qooxdoo.org/documentation/0.7/class_declaration#members
[2] http://blog.qooxdoo.org/dramatically-improved-ie7-javascript-performance
--
View this message in context:
http://www.nabble.com/this.self-tp14190715p15413541.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel