Property support in qooxdoo 0.6.x
This article is a compact overview of the property system as supported by qooxdoo 0.6.x. It focuses on the declaration, and reveals some of the shortcomings that are being addressed by the new property implementation for qooxdoo 0.7.
qx.OO.addProperty({ name : example, type : "string", possibleValues : [ "top", "bottom", "right", "left" ] });
Shortcomings of the old system
Type declaration
- Type declaration differs from known types of the API viewer
- Simple typeof and instance checks are often not enough
- Custom check method is not well integrated and can be overridden
Value handling support
- Problems with the appearance support, where user values may be overwridden by the appearance theme
- No inheritance to support properties such as
enabledto work on a whole widget structure.
Performance issues
- The properties were created directly with the class definition. This is a relatively complex process and was done in all cases independent of the usage of the property.
- The system was designed in a phase where qooxdoo had about fifty properties. Currently we have about more than 300. The implementation must scale a lot better than the old one.
- The performance of the setter which are dynamically created is sub optimal. One reason may be the large feature set, which is processed on each call of the setter independent of the complexity the property itself required.
- The closure style declaration used in qooxdoo 0.6.x leads to a slower variable name lookup which also reduces the performance of the setters.
