| Graphic Components > Architecture of Graphic Components > The Adapter |
The Adapter |
INDEX
PREVIOUS
NEXT
|
The adapter is an object that acts like a bridge between a data source and a graphic component. It converts the business objects of the data source (IlpObject instances), which are component-independent, to representation objects which are suitable for a given representation model, that is, for a given graphic component. For information about the representation model and representation objects, see The Representation Model.
The use of adapters is optional as you can directly instantiate and insert representation objects into a representation model. However, they are highly recommended as they hide the complexity of creating representation objects relationships. Using adapters, you do not need to care about representation objects. All you have to do is create the business model in the data source and customize the view and objects using CSS to obtain an attractive graphic representation.
By default, adapters are meant to work in conjunction with a data source. By default, they are used in all JViews TGO graphic components.
Adapters also handle synchronization.
JViews TGO supplies four kinds of adapter, each corresponding to a specific type of representation model:
These adapters are all based on an abstract adapter, defined by the interface IlpAbstractAdapter.
The following figure shows interfaces that are directly related to adapters.
This diagram shows that an adapter knows a data source. The adapter listens to the data source, which notifies it whenever a new IlpObject instance is created. Once a new object is added to the data source, the adapter creates the corresponding IlpRepresentationObject instance if the adapter configuration allows it.
In some cases, adapters can also contain temporary representation objects that are created independently of the corresponding business object (before it is created and retrieved from the data source). These temporary objects are stored in the adapter along with a means to determine whether the corresponding business object has been created. For more information, see Creating a Temporary Representation Object in section Network Component.
All adapters suppor filtering of business objects. When a filter is set to an adapter, only IlpObject instances in the data source that satisfy specified conditions are represented in the representation model. This filter is defined by the interface IlpFilter. For more information, see the respective graphic components sections.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |