Design Patterns - Overview

Software entities should be open for extension,but closed for modification——Bertrand Meyer

Open for extension, closed for modification - "Open-Closed Principle"

 

E.g:

You need to design an APP similar to the alliance. This APP can generate a variety of different hairstyles, face shapes, and eyes, but we don't know what needs of users in the future. How to make the software expandable without being tied What about moving the whole body? Practical and hard-working people may confidently sum up a set of their own code design style, but looking back, it has been thousands of years. Standing on the shoulders of giants and succeeding is also called success. Why not do it with external force, the design pattern is like Taijiquan moves, to be integrated into the bones, but it seems to have been forgotten. It is easy to use and easy to use~~~

First of all, what are design patterns?

Design Pattern is a set of repeated use, known by many people, classified and catalogued, and a summary of code design experience.

Why use design?

Design patterns are used to reusable code, make code easier to understand by others, and ensure code reliability. There is no doubt that design patterns are a win-win for yourself, others and the system; design patterns make coding truly engineering.

What design patterns are there?

There are three types of design patterns, a total of 23.

      Creation patterns: singleton pattern, abstract factory pattern, builder pattern, factory pattern, prototype pattern.

      Structural patterns: adapter pattern, bridge pattern, decoration pattern, composition pattern, appearance pattern, flyweight pattern, proxy pattern.

      Behavioral patterns: Template method pattern, command pattern, iterator pattern, observer pattern, mediator pattern, memorandum pattern, interpreter pattern, state pattern, strategy pattern, responsibility chain pattern, visitor pattern.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326331076&siteId=291194637