About Composite Classes

Composite Classes are classes that contain another class or classes. The Composite Class has all of the attributes of any class or classes it contains to reduce the work involved in creating CIMPLICITY objects.

Example of Composite Classes

In this example, a CIMPLICITY project named RESETPT.gef, there are three classes, BufferTankArray, tank and VALVE.

??The class named Valve is a low-level class. It has no composite members.

However, BufferTankArray, contains two composite classes. InletVale and OutletVale are both defined with the Class ID of "tank." Therefore, they contain any attributes contained in the class "Tank." Using composite classes, you only need to define the class "Tank" once and then reuse it over and over again when designing your project.

Note: Composite Class inherit just the attributes of the classes they refer to. They do not inherit scripts, events or other features of they classes they refer to.

Character Limit and Composite Classes

The composite member name is used in the name of the points for data item in the class that get created for each object instance, and there is a limit of 256 characters for the fully realized pointIDs. ??To stay under the character limit, carefully consider the naming you use when creating composite member names. ??For example, a class that contains a composite member named FillValve, of class valve, would create points with the following names (if ??the Valve class had data items FlowRate, and ValvePosition.)

<$ObjectID>.FillValve.FlowRate

<$ObjectID>.FillValve.ValvePosition

Composite Members Can Refer in Both Directions

Not only do container classes automatically have the values of classes that it contains, you can have composite member attributes use the values of the attributes of its container classes. ??When supplying the value of a composite members attributes within the class definition, you can refer to the container attributes by using a syntax {..\<AttributeName>}. This syntax ??would refer to an attribute in the immediate container class and {..\..\<AttributeName>} refers to an attribute two levels up in the container hierarchy.