Adapter mode
What kind of environment and problems do you use?
In-game mounts---multicolored deer
In order to increase the playability of the game, we want to make him (fly up)!
The need for extensibility
New interface Requirements Fly
Think about how to get this deer to fly??
Don't forget our principles----Modify the closure principle
Closed for modification
Try not to move the original written business class
What kind of environment and problems do you use?
Want to use an existing class, but his interface does not meet the requirements
Talk about a tired interface that translates into the client's desired interface
Yes, it was originally used for incompatible interfaces two classes that cannot work together can work together
This article is from the "Make a few" blog, be sure to keep this source http://9399369.blog.51cto.com/9389369/1621236
Software Architecture---Adapter mode