Document Information

Last modified:
2007/05/31 19:05 by fjakobs

Cached Object Properties

Cached properties are the light version of real (user-side) qooxdoo properties. They are used for simple caching and invalidation of single values.

For example the computedBoxWidth is a cached property. At any time the environment or the values of the widget changes the cache will be invalidated and will be recomputed the next time needed. There are many parts in qooxdoo which needs a feature like this, so we have lately seen that it’s the best to generate the needed function pairs also automated. The only public method here is the getter. That mean for example in the application you can do a getCachedBoxWidth() , but you should never call any other function (all marked as private, with the typical “_” at the beginning of the function name).

Cached properties use a nearly similar syntax compared to the real properties. They are limited in features to make them really fast. There is no type detection or check. There is no modifier called. There is no event fired on change of the value.

Here comes a example how to use this feature:

qx.OO.addCachedProperty({ name : "boxWidth", defaultValue : null });
 
// optional method (but most time is make no sense without)
proto._computeBoxWidth = function()
{
  // some algorithmus to execute to compute the new value
  return foo * this.getBar() + 3;
};
 
// if you need to do something on update, define it here.
// will only be called if _recomputeCachedBoxWidth() will be used
proto._changeBoxWidth(vNewValue, vOldValue) {
  // your code to handle this change
};

Information

Last modified:
2007/05/31 19:05 by fjakobs

Account

Not logged in

 
 

Job Offers

To further improve qooxdoo we are seeking javascript developers. Read more...

Rich Ajax Platform (RAP)

RAP uses qooxdoo, Java and the Eclipse development model to build rich web applications. Read more...

qooxdoo Web Toolkit (QWT)

Similar to GWT this framework allows to create impressive qooxdoo applications just using Java. Read more...

Pustefix

Pustefix is a MVC-based web application framework using Java and XML/XSLT. Read more...

 
SourceForge.net Logo

Bad Behavior has blocked 0 potential spam attempts in the last 7 days.