Literally, "binding" means to bind several objects together. When data binding is used, Flex copies the data of an object and provides it to another object. literally, "binding" means that several objects are bundled together. When data binding is used, Flex copies the data of one object and provides it to another object. The data source object is provided by the data provider (PHP blog, www.phpcq.com) the data used is called the target object. when the data source object changes, the data of the target object is automatically updated without the need to write code to force update. this is the meaning of binding. This feature of data binding is very practical. when a program needs to process a large amount of data and maintain real-time updates of the data, it is often costly for developers to maintain data synchronization, today, you don't have to complain about this type of problem.
In fact, the implementation of binding is also completed by using the event mechanism. When data is bound to the target object, the target object will listen to a fixed event of the data source object. in the future, when the source object changes, the data source will dispatch a change event, notifies the target object of the updated data ., (PHP blog, www.phpcq.com), but the process of this event is automatically handled by Flex.
Binding applies to various types of objects. you only need to bind the data of the source object to the same format as the data of the target object. Data binding is frequently used in the following situations:
1. bind the data obtained through web service or remoting to the control.
2. bind the Control Data to the background communication object and send it to the server.
3. bind the data returned from the background to the data model.
4. data binding of components or object attributes
As a data source object in the binding process, the object must support binding, that is, the object has the ability to dispatch and change events. The Flex component provides the binding interface. of course, not all attributes and methods of the component can be used as the data source. generally, important attributes of the component can be used as the data source in the binding.
Although the data binding function is very powerful, not all cases can be used. for example, in some cases, data updates must be strictly ordered and cannot be updated at the same time, in this case, it is best to set the data change through the program. In addition, once binding is started, every time the source data changes, the data of the target object will be updated, and sometimes the target object is expected to only respond under certain circumstances. (PHP blog, www.phpcq.com) then, binding is not a good solution.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service