Top 10 Design Patterns

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.