Pattern category of Design Pattern
Pattern classification:
1. objective criteria for classification
That is, it is classified based on the purpose of the pattern (what purpose,
① Creational ):
Object Creation
(Abstract Factory, build, factory method, prototype, sington)
② Structural)
Processing class or object combination
(Adapter, bridge, composite, decorator, facade, flyweight, proxy)
③ Behavior (behavioral)
Describes how classes or objects interact and how responsibilities are assigned.
(Interpreter, template method, chain of responsibility, command,
Iterator, mediator, memento, observer, state, strage, visitor)
2. Scope criteria Classification
That is, the mode is mainly used for classes or objects.
Class mode, which focuses on the relationship between classes. by inheriting and establishing this relationship, the variation is deterministic and static.
The object mode is more dynamic and can be changed at runtime to process the relationship between objects.
Creation class mode: factory Method
Delays part of the object's work to the subclass.
Creation Object Mode: Other all of creational
Delays object creation to another object.
Structural class mode: adapter (class)
Use Inheritance Mechanism to combine classes
Structure Object Mode: adapter (object) and other all of structural
Describes how objects are assembled.
Behavior class mode: Interpreter, template method
Use inheritance to describe the algorithm and Control Flow
Behavior Object Mode: Other all of behavioral
Describes how a group of objects can collaborate to complete tasks that cannot be completed by a single object.
The above is a summary of the classification of design patterns.