After learning about the history and classification of the design patterns, how should we learn the design patterns? Before learning the design model, the reader must establish a consciousness that the design model is not only a method and technology, but also an idea and methodology. It has nothing to do with a specific language. The main purpose of the learning and design model is to establish an object-oriented idea, as far as possible to interface programming, low coupling, high cohesion, make the program you designed reusable as much as possible.
Some software developers always want to set up a certain design pattern during program design. In fact, this is not correct and they do not really grasp the idea of the design pattern. In fact, the reader often uses a certain design pattern, but does not know the name of this pattern. Therefore, when designing a program, you must use the appropriate design mode according to your own understanding.
Some other software developers give the Class A name similar to the pattern when designing the program, such as the name of a certain Fa C ade or a certain Factory, in fact, the content in the class has nothing to do with the design model. It is just used to advertise that you understand the design model.
Therefore, to learn the design model, you must first understand the design patterns that can be used by developers, and then study the principles, timing, and methods of each design pattern separately, that is to say, when a design pattern should be used, and when the timing of a design pattern should be understood, what kind of consequences will be caused if this design pattern is not used at this time. After understanding the principles and usage of each mode, it is more important to learn the object-oriented ideology. After understanding the object-oriented ideology, looking back at the design model, we will have a deeper understanding. At last, we must study the design model diligently and practice more.