Adapter pattern
Problem
Imagine you are traveling to a foreign country and once at your hotel room you realize your power cord socket is not compatible with the wall socket. Luckily, you remembered you’ve brought your power adapter with you. It will connect your power cord socket on one side and wall socket on the other side, allowing for communication between them.
The same situation may arise in code, when 2 (or more) instances (of classes, modules, etc.) want to talk to each other, but whose communication protocol (e.i. the language they use to communicate) is different from each other. In such a situation, the Adapter Pattern comes in handy. It will do the translation, from one side to the other.
Solution
Discussion
Adapter is useful when you have to organize an interaction between two objects with different interfaces. It can happen when you use 3rd party libraries or you work with legacy code. In any case be careful with adapter: it can be helpful but it can instigate design errors.