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 Car class would implement the interface TopLevelTeaObject, because this class represents the product itself.
  • The CarBody and CarEngine classes would implement the interface SingletonTeaObject, because each car has only one body and one engine.
  • The CarWheel class 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.

Related tasks