<<< Structural Patterns | Index | Adapter UML Diagram >>> |
Problem to solve:
We need an interface of an abstract class Base.
We already have another class named Done that implements the needed behavior.
Unfortunately, class Done has the wrong interface, incompatible with Base.
Solution:
Derive new class named Adapter from the Base.
Add Done object as a member to the Adapter class.
Use thin layer of code around Done object to implement the desired Base interface.
<<< Structural Patterns | Index | Adapter UML Diagram >>> |