Adapter Pattern

Overview

Convert the interface of a class into another interface the client expects. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

Participants

Target

Adaptee

Adapter

Parameters

Attribute

Initialization variant

Sample request

Create Pattern Links

There are two variations of the Adapter pattern, object adapter and class adapter:

  • Class adapter
  • Object adapter

    Applicability

    Use the Adapter pattern when