Property Features
Value checks
- built-in types for most common things
- instance checks by simply define the classname of the class to check for (always use an instanceof operation - a real classname is not available anymore)
- custom check method by simply attaching a function to the declaration
- custom check defined by a string which will be compiled into the resulting setters (faster than the above variant)
- define multiple possible (primitive) values using an array
Advanced value handling
- Multi value support. Support to store different values for init, inheritance, style and user including a automatic fallback mechanism between them.
- Inheritance support. Inhertitance of properties defined by a parent widget e.g. inherit enabled from a groupbox to all form elements. Used the inheritance if the computed value would be
undefinedor explicitly set toinherit. The getter simply returnsinheritfor inheritable properties which are otherwise unset. - Blocks unintentionally
undefinedvalues in all setters with an exception. To reset a value one must use theresetorunstylemethod which are available too. - Overriding of a value by setting a property explicitely to
null - Properties must be explicitely configured as
nullable(like in .Net). The default isfalsewhich means that incomingnullvalues will result in an exception. - Accessing nullable properties with
undefinedvalues will result in a normalization tonull.
Convenience
- Convenient toggle method for boolean properties
Notification
- Support for a custom apply rountine
- Event firing with a custom named event
Initialization
qooxdoo automatically correctly initializes properties. This is true for both, properties which have defined an init value and also for the other properties which are nullable. This means that after you have created an instance the properties correctly reflect the applied value. Default values assigned by init also execute the configured apply methods and dispatch configured events to inform already added listeners.
Performance
Automatic optimization of all setters to the optimal highly-tuned result code. Impressive tailor made high performance setters are the result.
Please note that after the definition point of a property the setters are not yet available. Wrappers for them will be created with the first instance and the final code will be generated with the first use of such a setter. This first use will also automatically unwrap the property setter to directly use the generated one.
Memory managment
Automatic memory management. This means all so-configured properties which contain complex data objects get automatically disposed with the object disposal. The affected built-in types are already auto-configured this way. Also all properties which need an instance of a class, defined by using a classname as check are automatically handled.
For all other properties which contain complex data the developer must add a dispose key with a value of true to the property declaration. For example if there is no check defined or the check definition points to a function.
