Enter the "design mode"

Source: Internet
Author: User

I. Concept of Design Pattern

The design patterns (Designpattern) are a set of summaries of code design experiences that are repeatedly used, known to most people, classified and catalogued. The design pattern is used to make code reusable, make it easier for others to understand, and ensure code reliability. The detailed description is as follows:

1. The design pattern includes a set of rules for solving specific tasks in the ideal software;

2. The design pattern describes a solution to a specific design problem that often repeats in a specific design environment;

3. The design pattern is a successful reusable design scheme which is summarized from many excellent software systems;

4. Each design pattern describes a problem that occurs repeatedly around us and the core of the solution to the problem, so you do not have to repeat the work when using the solution;

5. the design model provides solutions to related problems.

The design pattern makes code compilation truly engineered, and is the cornerstone of software engineering, just like the structure of a building. In fact, our training plan for advanced training is a training mode that Mr. Mi summarized based on his learning experience and years of teaching experience.


Ii. Design Principles

There are several object-oriented principles: open and closed principles (OCP), LSP, DIP, and ISP), synthesis/aggregation Reuse Principle (CARP), minimum knowledge principle (PLK, also called the Demeter rule ). The principle of openness and closure is idealistic and is the ultimate goal of object-oriented design. The other several items can be seen as the implementation method of the open and closed principle. The design pattern is to achieve these principles, so as to achieve code reuse and increase maintainability.




Iii. four elements of the design model

1. Mode name(Pattern Name)

It uses one or two words to describe the model's problems, solutions, and effects.

2. Problem(Problem)

Describes when to use the mode. It explains the causes and consequences of design problems and problems.

3. Solution(Solution)

Describes the components of the design, the relationship between them, their respective responsibilities and collaboration methods.

4. Results(Consequences)

Describes the effect of the model application and the balance between the use mode.


Iv. Basic Mode

1. Create Mode: Singleton mode, abstract factory mode, builder mode, factory mode, and prototype mode.

2. Structural Mode: Adapter mode, bridging mode, decoration mode, combination mode, appearance mode, metadata mode, and proxy mode.

3. behavior mode: Template Method mode, command mode, iterator mode, observer mode, intermediary mode, memorandum mode, interpreter mode, status mode, policy mode, responsibility chain mode, and visitor mode.


Before learning, we should first have a general understanding of the design model and a macro understanding. After looking up and reading the road, we should bow down and pull the car. One by one, we should study hard and study hard. I believe that with the help of this interesting and close-to-life novel "big talk design model", you will enjoy the study at this stage. Come on!


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.