The design pattern is called the program development, the system design, the code optimization Essential Good product, the young and the young is suitable! So what exactly is design mode? In fact, the design pattern is in the object-oriented language development process,
Encountered a variety of scenarios and problems, proposed solutions and ideas, precipitation is the design mode! In fact, design patterns are routines, solving the problem of the routine. We learn design patterns,
is to stand on the shoulders of predecessors, can be faster and more friendly solution design and optimization!
GOF23 design patterns are divided into three categories: the creation of design patterns-the creation of objects of interest, structural design patterns-the relationship between classes and classes, and behavioral design patterns-the separation of concerns about objects and behaviors.
Decorator mode is a structural design mode, and is the most complex structural design mode! The conventional structure design pattern is to complete the design by using the combination better than the inheritance.
But the adorner pattern is a dynamic extension of the functionality implemented with combination + inheritance,
Reprinted from the public number of soft education.
Design pattern Introduction (GO) design pattern classification