My views on design patterns (1): Overview of design patterns

Source: Internet
Author: User

(1) Overview

What is the design model:

Design pattern is a set of summary of the Code experiences that are repeatedly used, known by most people, classified and catalogued.

(2) Why should we use the mode? (What can the mode do for us)

1. A good system requirement, careful analysis, and no good design are acceptable. Therefore, I suggest you pay attention to design pattern, which is an opportunity for everyone to make all-round progress, it is also the road to being pragmatic.

2. Reuse considerations. Some modes can enhance the reuse capability of encapsulated classes.

3. effectively handle changes in demand, so as to remain unchanged

4. The design mode can reduce the coupling and dependency between different analysis classes.

5. The most effective way to learn others' experiences

6. You can make your design the same as that made by experts.

7. bring you new design ideas.

8. Better understanding of others' work. If you do not understand the mode, you may not understand others' work.

9. The design pattern is used to make code reusable, making it easier for others to understand, and ensuring code reliability.

(3) Importance of models in development

As mentioned above, the emergence of the design pattern is a good solution to solve the same problems in project development. It is an important cornerstone for project maintenance and upgrade. If we compare the project with building a house, the design model is one by one brick which can be split and added and expanded. If we imagine that your house is pasted with mud, it is obviously a one-time product, and once a problem occurs .... (Do you dare not ). If a project is a product, we should try our best to make these designs. Although we have made some costs (square bricks are made from clay burning, of course they need to be cost-effective) however, this project is more robust and scalable, greatly reducing the maintenance workload for the same problem. The interactions between programmers are more modeled. Why not, therefore, the application of the model in the project is indispensable.

(4) analysis of the general framework of the Model

I prefer to use the following classification methods. First, we need to summarize which types of design patterns are used to solve the problems (this will be reflected in each mode)


(5) basic conditions for learning the design model

As the saying goes, "if you want to exercise your power, you must first go to the palace, even if you do not succeed ." This may sound interesting and evil, but it does reflect very real problems. The prerequisite for "exercise the power of the uterus first" is that "even if the uterus is not successful" is a result. It is not your womb that you will be able to become a peerless power, but you also need to look at the innate spirit and the efforts of the day after tomorrow. After talking so much nonsense, what I want to express is very simple. The design model is very abstract and the entry threshold is not too high, but there are not many people who can use it flexibly after learning it. What are the prerequisites for us to enter this field?

2. object-oriented programming ideas: three core content concepts: abstraction, inheritance, and Polymorphism

2. Skillful Use. any language in. Net (all examples will be written in C # in the future, so I hope you can learn more about C) be familiar with language implementation methods such as interfaces, inheritance, polymorphism, delegation, and events

2. Familiar with UML modeling

2. Have some project experience (I ignore this when reading many of my friends write articles about design patterns, from the perspective of my personal growth process, learning design patterns is not a good way to learn from theory alone. It is easy to make people think about patterns. We learn design patterns instead of learning them, learning to use it and learning how to use it flexibly has a lot to do with personal project experience)

 

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.