Design Patterns explain - first an acquaintance of design patterns

Design Patterns explain - first met design patterns

039bed05819117eeae88b0eecb3fb5b0.jpg

What design patterns?

    Design patterns are useful in the face of people experience the same type of software engineering design problems summed (predecessors is a summary of the code development experience, is to solve a specific problem a series of routines). Design mode is not code, but universal design solution of certain problems. It reminds me: There is a blind alley and take more people, they will become a road.

Wikipedia introduction:

image1.png

23 design patterns summarized by:

Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides summary wrote "design patterns" in 1995.

The best way to learn design patterns: In your previous design and engineering inside to find where to use them.

Essential purpose is to design software engineering mode to O (N) in the maintenance, scalability, variability, complexity.

Design patterns can be divided into three categories:

One: Create schema

II: Structure pattern

Three: behavioral patterns

What are three models each contain specific patterns? As shown below:

image2.png

The relationship between design patterns, as shown below:

image3.jpeg

Thinking question:

image4.png

In fact, Java IO streams kind of class design decorator pattern is used. As for the advantages of the Decorator pattern, we explain in detail

Digression:

Several principles of design patterns

1: Open Closed Principle

image5.png

2: Richter substitution principle (LSP)

image6.png

3: Dependency Inversion principle

image7.png

4: Interface Segregation Principle

image8.png

5: Law of Demeter (know at least in principle)

image9.png

6: Synthesis of multiplexing principles

image10.png

7: Single Responsibility Principle

image11.png

This article comes from Kaige Java (kaigejava)

Kaige personal blog: www.kaigejava.com

From the seven principles above, we can see that, in fact, a design pattern is the design of software, starting from large-scale software architecture, for example upgrades and maintenance easy. All, we often hear low coupling, high cohesion. This is a characteristic of the spring.


Guess you like

Origin blog.51cto.com/kaigejava/2427954