In work, design patterns are often used to enhance the flexibility of software. However, it is really difficult to arrange positions for them, because everyone understands the design patterns, the programming language, personal habits, and nature of work that everyone uses will affect rankings. Click here to list your rankings (only the design pattern mentioned in design pattern ).
Champion:Strategy Pattern
Reason: Strategy encapsulates some arithmetic rules to make them interchangeable. There are always several options in your work. You need to compare them and select the most suitable algorithm. Therefore, you can use the most frequently.
Runner-up:Factory pattern
Reason: there will be operations to create objects in a program, so there will be a lot of opportunities to use them.
Runner-up:Observer Pattern
Reason: I just want to ask a question. Have you used the callback function?
Fourth:Facade Pattern
Reason: In order to encapsulate the complicated system you have written, you have provided a simple and unified interface for the user. You have encapsulated a class. Have you ever done this?
Fifth:Mediator Pattern
Reason: Why do I put the mediator mode in the fifth place? My personal understanding is that the mediator mode is not only a mode, but can actually be upgraded to the Framework Design of a program. Now it is more and more used.
Sixth:Iterator Pattern
Reason: When arrays and linked lists are used, you have the opportunity to use iterator pattern.
Seventh:Bridge pattern
Reason: separating implementation from logic is common.
Eighth:Template Method
Reason: extract common things into superclass. Different things are implemented in sub-classes. Are you familiar with them?
Ninth:Command pattern
Reason: send a request. This is what we like to do. The reason is far-fetched.
Tenth:State Pattern
Reason: an object has different states, and there are many such cases.
The above ranking is just a personal idea, and I cannot say a good reason for it. How do you think? Reasons.