An Example of the Adapter Pattern (Design Patterns)

_config.yml

The General Concept (Without code)

If you need to plug in a device, but you don’t have the appropriate plug (interface) you will need some sort of adapter to allow you to connnect to that particular electricity socket.

Coded Example of the Adapter Pattern

I hope the code snippet below suffices to explain the concept.

If you have any questions, feel free to ask.

Written on September 29, 2017