Extending a predefined business class in XML

To extend a predefined business class dynamically, you can create a new instance of IlpDefaultClass from an XML description of the class.
The following example demonstrates how to create a subclass of a predefined business class in XML.

How to create a subclass of a predefined business class in XML

<class>
    <name>Element</name>
    <superClass>ilog.tgo.model.IltNetworkElement</superClass>
    <attribute>
      <name>throughput</name>
      <javaClass>java.lang.Integer</javaClass>
    </attribute>
</class>
The syntax is the same as for creating a regular class with XML. See Defining the business model in XML.
The newly created class extends the IltNetworkElement predefined business class and has an additional attribute ( throughput ).
This class is an instance of both the IlpClass Element and the Java™ class ilog.tgo.model.IltNetworkElement .
As shown in the following figure, an instance of Element derives from two class hierarchies: the dynamic class hierarchy and the Java class hierarchy.
tgo_predefined_class_inheritance.png
Deriving instances from the dynamic and the Java class hierarchies
If you create an instance of the IlpClass Element with XML, the created object will be an instance of the Java class IltNetworkElement.