This pattern is similar to the Decorator and Adapter patterns from the Gang of Four (GoF) design patterns catalog [1]. The Decorator pattern dynamically extends an object transparently without using subclassing. When a client uses a Decorated object it thinks it's operating on the actual object, when in fact it operates on the Decorator. The Adapter pattern converts the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
There are several differences between these two GoF patterns and the External Polymorphism pattern. The Decorator pattern assumes that the classes it adorns are already abstract (i.e., they have virtual methods, which are overridden by the Decorator). In contrast, External Polymorphism adds polymorphism to concrete classes ( i.e., classes without virtual methods). In addition, since the Decorator is derived from the class it adorns, it must define all the methods it inherits. In contrast, the ConcreteCommon class in the External Polymorphism pattern need only define the methods in the Concrete class it wants to treat polymorphically.
The External Polymorphism pattern is similar to the GoF Adapter pattern. However, there are subtle but important differences:
The External Polymorphism pattern is similar to the Polymorphic Actuator pattern documented and used internally at AG Communication Systems.
0=6 =0.90 .55 -0 =.9
0