| Business Objects and Data Sources > Data Sources > Adding Business Objects from JavaBeans |
Adding Business Objects from JavaBeans |
INDEX
PREVIOUS
NEXT
|
The default implementation of the IlpDataSource interface provides an API that directly supports JavaBeans objects. This API transforms JavaBeans objects into IlpObject instances of type IlpBeansObject.
If necessary, see Reminder About JavaBeans Design Patterns.
The example below shows how to add JavaBeans objects to a data source. It reuses the MO class defined in Defining the Business Model from JavaBeans Classes. Objects are created as regular Java objects, inserted in a data source, and modified by means of their set methods.
MO mo1 = new MO("mo1");
dataSource.addBean(mo1,"mo1");
mo1.setState(2);
Once in the data source, these objects can be displayed in the various JViews TGO graphic components. Bound property updates are dynamically reflected in these components.
The figure below shows an MO object displayed in a tree component.
| Note |
| The graphical result depends also on the style information associated with the object. Here, the state attribute is mapped to a color. See Introducing Cascading Style Sheets of the Styling documentation for details. |
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |