| Business Objects and Data Sources > The Business Model > Business Class Manager API |
Business Class Manager API |
INDEX
PREVIOUS
NEXT
|
Once business object classes are created, it is important to make them available to the whole application and allow them to be used by all the components. This is the role of the class manager defined by the interface IlpClassManager. This interface provides methods to:
IlpClass from an identifier.
For example, the following function writes the entire content of a class manager. It iterates over all the classes stored in a class manager and then over their attributes, displaying the class they belong to along with their default value, if any.
public void displayModel(IlpClassManager classManager) {
for (Iterator i = classManager.getClasses().iterator();
i.hasNext();) {
IlpClass ilpClass = (IlpClass)i.next();
System.out.println(ilpClass.getName());
if (ilpClass.getSuperClass() != null) {
System.out.println("\t"+ilpClass.getSuperClass().getName());
}
for (Iterator j = ilpClass.getAttributes().iterator();
j.hasNext();) {
IlpAttribute attr = (IlpAttribute)j.next();
System.out.println("\t" +attr.getName() +": "
+attr.getValueClass().toString());
if (attr.getDefaultValue() !=
IlpAttributeValueHolder.VALUE_NOT_SET) {
System.out.print("\t\tdefault: " +attr.getDefaultValue());
if (attr.getDefaultValue() != null) {
System.out.print(" " +attr.getDefaultValue().getClass());
}
System.out.println();
}
}
}
}
JViews TGO provides a default implementation of the class manager, which is defined by the class IlpDefaultClassManager. This implementation has the following additional functionality:
IlpClass defining the Java class is not yet present in the class manager, an IlpBeansClass is created and the attribute group is automatically built through introspection in the Java class. | Note |
You can deactivate this behavior or provide a specific IlpClass implementation for your Java classes as described in Defining the Business Model with Dynamic Classes.
|
JViews TGO also provides a class manager implementation to automatically handle the predefined business classes. This implementation is defined by class IltDefaultClassManager.
For easier access to the business classes information in your application, the class manager has been defined as one of the application context services. Refer to Class Manager in the Application Context and Deployment Descriptor documentation for information on how to customize the class manager information through the application context and the deployment descriptor.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |