Classification of design patterns
A design pattern is a set of repeatedly used, widely known, catalogued code design lessons.
Design patterns are used to reuse code, make it easier for others to understand, and ensure code reliability; design patterns make code truly engineered; design patterns are the cornerstone of software functionality, just like the structure of a building.
There are 23 design patterns divided into three categories, namely:
(1) Creation mode: mainly used to create objects.
There are five patterns: Simple Factory, Factory Method, Singleton, Builder, and Prototype.
(2) Structural pattern: mainly used to deal with the combination of classes or objects.
There are 7 patterns: Adapter pattern, Decorator pattern, Proxy pattern, Facade pattern, Bridge pattern, Composite pattern and Flyweight pattern.
Behavioral patterns: Mainly used to describe how classes or objects interact and assign responsibilities.
Total of 11: Strategy pattern, Template Method pattern, Observer pattern, Iterator pattern, Chain of Responsibility pattern, Command pattern, Memento pattern, State pattern, Visitor pattern, Mediator pattern, and Interpreter pattern.
These patterns will be examined individually in the following articles.