2. Software Design: the design model is just a hammer!

Source: Internet
Author: User

The design mode is just a hammer!

When talking about the design model, it was almost unknown and unknown. The famous "gof" (some Chinese translated as "the four-person gang") was an amazing work. It was really "no one knows about gof in my life, and I have never learned how to design it!"

However, the design model is really the "Swiss Army Knife" of software design. Are you proficient in cutting, cutting, sawing, and drilling?

There are a lot of people who have read the design patterns, but few people have really noticed the design patterns. This subtitle is the key to avoiding misunderstanding of the design patterns. The subtitle of design patterns is:The basis of reusable Object-Oriented Software!

Do not underestimate this short sentence. If you have not read this sentence, or you have never carefully understood it, you may think that the design model is a Swiss Army knife ", can solve all the design problems, but in fact"The design pattern is just a hammerThere is a saying: "If you have a hammer in your hand, all the problems will turn into nails, it either gets knocked out or does not work.

Why is the design pattern just a hammer? We can see from the subtitle. The subtitle of design patterns reveals two main constraints of design patterns:

1) the design model solves the following problems:Reusable"Design Issues;

2) the application field of the design model is"Object-oriented";

I believe that after my reminder, we can basically understand why the "design pattern is just a hammer:

1) the design model can only solve the "Reusable" design problems. Other problems, such as performance design, reliability design, security design, and service design, cannot be solved by the design model;

2) The design pattern is only used in object-oriented languages. If it is not an object-oriented language, it will not work very well. Of course, you can use the design pattern in the C language, but after all, it will take a lot of effort and it will not be so easy to use.

Therefore, when you encounter a problem and think about the design model, you must pay attention to "the design model is just a hammer". Don't hold this hammer everywhere!

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.