Adapter


Usage
  • Also known as: Wrapper
  • Match interfaces of different classes
  • Convert the interface of a class into another interface clients expect
  • Let classes work together that couldn't otherwise because of incompatible interfaces
Diagram
Adapter
Participants
Target
  • Defines the domain-specific interface that Client uses.
Adapter
  • Adapts the interface Adaptee to the Target interface.
Adaptee
  • Defines an existing interface that needs adapting.
Client
  • Collaborates with objects conforming to the Target interface.