TURBO-CHARGING DATA BINDING
75
[Bindable]
public class CustomerVO
{
[Bindable]
public var customerID:int;
public function CustomerVO(customerID:int) {
this.customerID = customerID;
}
}
}
The reason that the bindable tag is not needed for the CustomerID property is because the class is already
set to be bindable and every property in the class will be set bindable. This creates compile time errors and is
a waste of time writing the extra code
. Visit DevNet: http://www.adobe.com/devnet/
flex/articles/databinding_pitfalls.html to read more about databinding common misuse mistakes.
Summary
Data binding contains tremendous value, but also holds disadvantages. We recommend ensuring it is being
used correctly and when needed, because data binding can create overhead and memory leaks, which will
cause your application to suffer in terms of performance. In this chapter you learned about techniques for
using Data Binding. We covered one and two-way data binding using braces using MXML and binding tag as
well as the overhead associated with the process. You learned of using the BindingUtils class as well as
implicit and explicit data binding. We continued by showing you how to debug bindings and use a custom
TurboBinding Metadata.
We continued by explaining data binding between client side and server side by creating class and binding all
properties as well as binding using ObjectProxy class. Lastly, we helped you avoid common Flex data binding
pitfalls and common misuse mistakes by given examples.
In the next chapter, you will learn how to tune your applications for superior performance. You will be looking
under the hood of Flex and related Flash player features that impact performance.
CHAPTER 2
76
Get AdvancED Flex 4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.