Interface Style
In interface style, agent code models a managed object type by defining a class that implements interfaces such as TopLevelTeaObject, TeaObject or SingletonTeaObject.
A separate class represents each object type that you identified in your analysis of the product.
For example, in an oversimplified analysis of a car, you might identify managed objects representing the car itself, its body, engine and wheels. Your agent would model these managed objects with four corresponding classes:
- The
Carclass would implement the interface TopLevelTeaObject, because this class represents the product itself. - The
CarBodyandCarEngineclasses would implement the interface SingletonTeaObject, because each car has only one body and one engine. - The
CarWheelclass would implement the interface TeaObject, because each car has more than one wheel.
Your agent code creates Java instances of these classes to represent each managed object instance in the product. For example, the agent would instantiate one
Car, one
CarBody, one
CarEngine, and four instances of
CarWheel.