This pattern can sometimes be also called Wrapper, due to its purpose (note, this expression is also used for the Decorator Pattern). It serves as a connector between two incompatible interfaces/classes.
It’s most often used when we can’t modify the source code, e.g.:
– dealing with a class coming from an external API
– sending our object to a client, where client is not able to process our representation of the object
The main idea behind is, that we create an adapter (interface + class implementing it), where our constructor accepts the object we need to convert.
class targetImpl implements target
class adapteeImpl implements adaptee
class adapterImpl implements adapter
Last update 01.08.2019.
For possible mistakes in content or typos, I apologise and kindly ask you to report here.