Adapter Design Pattern

Publication: C++ Builder Developer's Journal
Issue: Volume 9, Number 3, March 2005

The adapter design pattern demonstrates techniques of how to adapt the interface of one class to match the interface of another. A very useful pattern that is often used to make disparate systems operate with a common interface.

The Adapter Design Pattern is used to convert one interface into another it is used by classes that are already in production, and which have an interface that does not match the one you need. The TSTLStringList and TVCLStringList classes[1] share the same interface, and therefore the classes are interchangeable. Consider however the scenario in which another programmer developed a class similar in functionality to these two except the interface (public methods) was different. Making the two interfaces work together is the task of the Adapter Pattern.