Design patterns II - Adapter pattern
There are 4 categories of design patterns called Gang of Four(GoF):
-
Creational patterns
-
Structural patterns
-
Behavior patterns
-
Concurrency patterns
Adapter pattern is a structural pattern.
Adapter pattern definition: Convert the interface of a class into another interface clients expect. An adapter lets classes work together that could not otherwise because of incompatible interfaces. The enterprise integration pattern equivalent is the translator.
UML:
For example, there are 2 targets that 2 different clients expects.