Adapter

Adapter comes in two variants; one based on multiple inheritance:

and one making use of delegation:

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. (See the STL container adaptors for a good example of adapting template containers.)

Applicability

Consequences