The UML Profile for Framework Architectures
7.6 The AOCS manager pattern
There is noticeable similarity between the Controller and Telemetry design patterns. Both rely on a 'manager' which maintains (or has access to) a list of objects. The manager does not know the exact type of each of the objects in its managed list. Instead, the manager only knows that each of the objects is an implementation of a particular interface. The interaction between the manager and each managed object is solely through this 'manageable' interface. The manager has a method (in both cases called activate) which serves as a template method in an application of the Separation construction principle. The activate method cycles through all the managed objects and performs an operation on each by calling one or more of the hook methods defined in the manageable interface. Figure 7.14 shows this Manager pattern in a more generic manner. Note that the Manager pattern is a sort of higher level pattern that captures a similarity among the more specific patterns that are defined by the framework.
Figure 7.14. The Manager pattern relying on the Separation construction principle
This pattern has proven to be useful in the AOCS framework for separating the management of a set of objects with similar functionality from the actual implementations of that functionality. Therefore, following the template of Chapter 4, we introduce this pattern as an AOCS-specific pattern and create a set of domain-specific tags.
The UML-F tags for the Manager pattern are:
Mngr Manager
Mngr activate
Mngr managed
Mngr Manageable
Mngr operationN
Mngr ConcreteManageable
Mngr operationN .
Table 7.1 summarizes the UML-F tags for the Manager pattern.
Names | Mngr Manager , Mngr activate , Mngr managed , Mngr Manageable , Mngr operationN , Mngr ConcreteManageable and Mngr operationN . |
Apply to | class ( Mngr Manager , Mngr Manageable , Mngr ConcreteManageable ); method ( Mngr activate , Mngr operationN , Mngr operationN ); interface ( Mngr Manageable ) association ( Mngr managed ). |
Type | default: String; Mngr-operationN : Int |
Motivation and Purpose | The tags highlight the application of the Manager pattern in a framework by marking the classes, interfaces, methods, and associations belonging to that pattern. |
Informal explanation of effect | The Manager pattern separates the management of a set of objects which have similar functionality from the implementation of the functionality. This allows the management aspect to be implemented as a generic, reusable part of the framework. Specific behaviors are built into concrete implementations of the Manageable interface. They implement the various operationN methods. |
Expansion | The Manager pattern tags expand to tags for the Separation construction principle. |
Discussion | The pattern tags Mngr Manager , Mngr activate , Mngr Manageable , and Mngr operationN must always be used together. The other tags for this pattern are optional, but can only be used in conjunction with the former list of tags. Several different methods within the same class/interface can be tagged with the Mngr operationN and Mngr operationN . A specific number can be added as value of these tags. |
Applying these newly introduced tags, the design pattern underlying the Controller framework can be redrawn as shown in Figure 7.15.