Sometimes we could encountered a situation when we have a completely developed class and we are not allowed to modify it but we have to communicate with it. In that case we have to create and adapter to enable the class to communicate with us.
For example, let’s suppose that we developed a Log Engine as a library and that we shared this library with all developers in the company. In this Log Engine we are logging all events to Windows Events. If a developer wants to use our library to log all events to the database, we should create an Adapter class to wrap our Log Engine and start logging to the database.
The Adapter Pattern could help us to wrap up an noncommunicable class to become suitable with what it’s requested from the consumer class.
Adapter Design is very useful for the system integration when some other components have to be adapted by the existing system.
Adapter Design Pattern Structure