O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25.2. Data Binding

Data binding is not unique to Cairngorm. However, it is the primary mechanism for updating views using the ModelLocator. Putting a lot of bindable data in a single class can create performance problems for your application. So while these criticisms are equally valid for data binding in general, they do have particular relevance to Cairngorm.

Data binding is a nice convenience feature. It is relatively simple for the programmer writing the code to tie properties on a view to a variable with data binding — then, magically, the views change whenever the data does. In many languages the developers themselves have to write the code to update the view.

As with many of the nice features of many programming languages, "nice" does not come without a cost. While you, the developer, no longer have to write the code to update the views, this is only because Flex does it for you. A lot of code gets generated behind the scenes to make data binding work.

If you are unfamiliar with what actually goes on when you use data binding, a description can be found in the Adobe Live Docs at http://livedocs.adobe.com/flex/3/html/databinding_2.html#162751, which reads as follows:

Binding occurs under the following circumstances:

  1. The binding source dispatches an event because the source has been modified. This event can occur at any time during application execution. The event triggers Flex to copy the value of the source property to the destination property.

  2. At application startup the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required