1. Adapter mode
1) Class of Adapter mode
2) The adapter mode of the object
3) adapter mode for the interface
The adapter for the interface is this: sometimes we write an interface with multiple abstract methods, and when we write the implementation class of the interfaces, we must implement all the methods of the interface, which is obviously sometimes wasteful, because not all methods are needed, sometimes only some, here in order to solve this problem, We introduced an interface adapter pattern, with an abstract class that implements the interface, implements all the methods, and we do not deal with the original interface, only with the abstract class, so we write a class, inherit the abstract class, rewrite the method we need.
2. Decoration mode
3. Proxy mode
Note: The difference between the decoration mode and the proxy mode is that the proxy mode has control over the behavior of the proxy object, while the decoration mode has no control over the behavior of the decorative object, only a little modification, and the behavior of the decorated object must be executed eventually.
4. Appearance mode
Structural patterns of design patterns