The UML Profile for Framework Architectures
5.5 Recipe for adapting the Composite pattern
Chapter 4 introduced the tags of the Composite pattern. We use the prefix 'C' as a shortcut for Composite in the UML-F tags. Figure 5.6 shows the structure of the pattern and Table 5.5 presents the generic cookbook recipe.
Figure 5.6. The structure of the Composite pattern
Recipe 'Generic adaptation for the Composite pattern' | |
Intent | The recipe describes how to adapt a variation point that is designed according to the Composite pattern. Framework-specific considerations are not provided here. |
Classes |
|
Steps to Apply |
|
Discussion | See the discussion of the Composite pattern in Gamma et al. (1995). Particularly relevant are the following aspects: "Clients can treat composite structures and individual objects uniformly." They do not have to know whether they are dealing with a leaf or a composite component. |