One of the advantages of applying profile to reifying design patterns is that a user of design patterns can give his/her reification of the design patterns to reflect the specific development context. While authors of many patterns originally proposed some solution, we argue many different factors can affect the reification of a design pattern and there is no standard reification to realize a pattern. For instance, the inheritance relation between an abstract Observer class and a concrete Observer class in the Observer pattern cannot be implemented as a generalization/an inheritance when an implementation language such as Java does not support the multiple inheritance. On the other hand, a design pattern can have some limitations when it is applied to some applications. For example, if an application keeps adding new element classes, then it is hard to apply the Visitor pattern because all interfaces of related visitor classes must be modified to incorporate an operation to visit the newly added element classes. So some variations of the Visitor patterns have been proposed. We argue that a user of design patterns should be allowed to reify patterns based on his/her application. The UML profile mechanism is the best method to serve this purpose. As an example, we show two different reification for the Observer Pattern and several reifications of the variations of the Visitor pattern in the following.
We have designed UML profiles for the following Gang of Four (GoF) design patterns. In the diagrams showing part of each UML profile, stereotypes with the suffix "Op" are stereotypes of Operation; those with the prefix "a" are stereotypes of Association; those with 3-5 capital letters are stereotypes of AssociationEnd; those with the suffix "Dep" are stereotypes of Dependency; those with the suffix "Var" are stereotypes of Attribute. The rest are stereotypes of Class.
There are no profiles for Facade and Template. This is because the structure of the Facade pattern is too vague; it only has a Facade class with unidirectional associations to multiple unspecified classes in a subsystem. The Template Method pattern is too common and is used in the other patterns where an abstract class contains primitive operations and also some template operations, which are (re)defined in concrete sub-classes.
Here are instructions to apply the ICER tool to using design patterns.