Data source API

JViews TGO provides a default data source implementation, IltDefaultDataSource, to connect to XML files. This default data source includes methods for adding or removing business objects implementing the IlpObject interface or JavaBeans™, that is, Java™ objects that comply with the JavaBeans design pattern (see Reminder about JavaBeans design patterns). It also provides an API that lets you obtain structural information about the existence of a parent, children, an origin or a destination from the back-end and store it in the IlpObject .
To learn how to create a custom data source, see Implementing a new data source.
The interface IlpDataSource defines static data sources. It provides methods to:
  • Retrieve objects based on their identifier.
  • Retrieve all the objects stored in the data source.
  • Notify listeners about objects added or removed from the data source.
  • Retrieve structural information, such as parent, child and containment relationships.
The interface IlpMutableDataSource defines dynamic data sources. In addition to the methods listed above, it provides methods to:
  • Add and remove objects.
  • Set structural information, such as parent, child and containment relationships.
JViews TGO provides a convenience implementation of these interfaces that you can use directly when building an application: IltDefaultDataSource. This default implementation for a dynamic data source is able to read business model information from XML and to manage custom business objects as well as predefined business objects.
The following sample code shows how to create a data source instance to be used with the different JViews TGO graphic components.

How to create a data source

IlpContext context = IltSystem.GetDefaultContext();
IltDefaultDataSource dataSource = new IltDefaultDataSource(context);
A diagram of the data source classes and of their relationships is given in the following figure.
tgo_datasource.png
Data source classes