According to the msdn webcast courses)
Adaptation: basically, the original incompatible interfaces are converted into compatible interfaces without changing the original implementations.
Gof: to convert an interface of a class to another interface required by the customer, you have to work together the classes that cannot work together due to incompatibility of the original interface.
Object Adapter:
Use an existing class as a field of the adapter and inherit from the customerProgramThe expected interface class.
Adapter is the class we need to create and implement.
The following example shows how to use the existing object arraylist to implement the stack interface function required by the customer program:
Create an adapter:
Class adapter: (not recommended)
The adapter class inherits the interface that the client program expects and the existing class.
The adapter mode requires us to adopt interface-oriented programming as much as possible, so that it is easier to implement in the adapter.
<End>