Concepedia

Publication | Closed Access

External Polymorphism An Object Structural Pattern for Transparently Extending C++ Concrete Data Types

15

Citations

4

References

1998

Year

Abstract

This paper describes the External Polymorphism pattern, which allows classes that are not related by inheritance and/or have no virtual methods to be treated polymorphically. The pattern capitalizes both on C++ language features and on other basic patterns (e.g., Adapter and Decorator) to give the appearance of polymorphic behavior on otherwise unrelated classes. This pattern has been used in a number of C++ frameworks such as ACE and the OSE class library. 1 Intent The External Polymorphism pattern allows classes unrelated by inheritance and/or having no virtual methods to be treated polymorphically. Thus, these unrelated classes can be treated in a common manner by software that uses them. 2 Context Writing applications using reusable class libraries in C++ can be frustrating. Unless the original developer anticipated and covered all possible use-cases in the design, it's likely that at some point you'll run into a class that almost what you want. A common solution is to apply one ...

References

YearCitations

Page 1