Understanding the Adapter pattern
The Adapter pattern is a structural design pattern that provides a means for converting an existing, undesirable interface of a class to an interface that another class expects. An Adapter class will be the link for communication between two existing components, adapting the interfaces so that the two may share and exchange information. An Adapter allows two or more classes to work together that otherwise could not do so.
Ideally, an Adapter will not add functionality but will add the preferred interface for usage (or conversion) to either allow one class to be used in an expected manner or for two otherwise incompatible classes to communicate with one another. In its most simple form, an Adapter simply converts an existing class to support an expected interface as may be specified in an OO design.
An Adapter can be either associated with or derived from the class for which it is providing an adaptive interface. If inheritance is used, a private...