HeadFirst design pattern <2>
1 decorator pattern
Starbucks Coffee
Drink
to sum up
If the policy mode is achieved by a combination of elasticity, then the decorator pattern is to be achieved through inheritance, at the same time to achieve, customers using the basic feel of the decorator pattern
2 adapter mode
Object Adapter
Class Adapter
Turkey
to sum up
Decorator Pattern and the Adapter pattern very much like, adapter mode is the adaptation object interface, and the new responsibilities objects to the case of the decorator pattern does not change the object's interface.