Structural type: Adapter and facade (adapter and appearance mode)
Generally as a reading material, first of all want to clear is I now understand the design pattern of the original intention, that is, to solve what problem.
Adapter, if you have bought a port version of the iphone in the mainland to use people should have a triangle plug must be connected to a converter to use the general socket, of course, this is only a more intuitive feeling. In fact, we usually use the mobile phone charger is the adapter, imagine if we do not have this charger, how can we use ordinary sockets to charge mobile phone?
The definition of an adapter: Convert the interface you have at hand into the interface we need (business scenario: often used to fit the old program or to connect 2 sets of systems, when you can't make your docking system changes, we often need to do our own adaptation. )
The structure of the adapter:
Target Object-target
-adapted by the appropriate ligand
Adapter-adapter
Demo
Ready to go to work, after work to continue to organize ~
Design patterns for reading notes-adapters and appearance modes