This paper explains the appearance pattern through Lao Wang's transformation of the overall structure of Xiao Wang Company. the so-called appearance pattern is actually abstracting an interface from a variety of complex subsystems to hide the specific implementation details. when the caller calls, you only need to call the interface. In order to deepen our understanding, we will focus on the application of appearance patterns in the source code. finally, I have some thoughts on the learning process of design patterns.
With the deepening of Xiao Wang's entrepreneurship, the business modules of the company are becoming more and more complex. Whenever customers cooperate with him, they have to go deep into each module, and customers have to rely on each module of Xiao Wang, which brings difficulties to customers who use the module.
Now the structure of the company has evolved quite complex, customers visit you through various subsystems, you should integrate all your subsystems into a day before yesterday (interface). Customers only need to access your subsystem through this foreground (interface). This can solve the problem very well.
The solution proposed by Lao Wang is the appearance pattern, which makes it more accessible to multiple complex subsystems by providing a consistent interface.
The mode has a unified interface, and the external application does not need to pay attention to the specific details of the internal subsystem, which will greatly reduce the complexity of the application and improve the maintainability of the program.