Seeing the 30 days of the Nuggets posting more challenges, I want to try my best to stick to it for a few consecutive days. The prize is not important. Does it focus on participation?
In the next 30 days, I will lead you to learn design patterns. In the past, I always felt that design patterns were very complex and rarely used in general routine programming. After careful reading, I found how ignorant my previous ideas were. If a programmer wants to improve himself and make himself more valuable, the technical knowledge points of code specification and design pattern also need to be understood and mastered.
In fact, in daily development, we will use design patterns more or less, but we are not very clear. For example, we often use singleton mode, factory mode, etc.
The landlord is mainly engaged in C # development, and the code exemplified in the program uses C #.
Overview of design patterns
(abstraction, encapsulation, inheritance, polymorphism) is the basic concept of object-oriented (OO). OO principle is our goal, and design pattern is our practice.
There are 23 design patterns in total, which can be divided into three categories from the perspective of large structure, namely, creation pattern, structure pattern and behavior pattern.
This kind of pattern is a mechanism for creating objects, which can improve the flexibility and usability of existing code.
- Factory method
- Abstract factory
This paper introduces how to assemble objects and classes into a larger structure while maintaining the flexibility and efficiency of the structure.
- Enjoy yuan
Such models are responsible for efficient communication and responsibility delegation between objects.
- Chain of responsibility
- tertium quid
- template method
If you only have a hammer, everything looks like a nail. Then we should strive to have multiple hammers in our hands.
The most basic, underlying patterns are often referred to as idioms, which can only be used in one programming language.
The most common and high-level pattern is architecture pattern. We can use this kind of pattern in any programming language. Unlike other patterns, they can be used for the architecture design of the whole application.
A person’s struggle, like pregnancy, will always be seen after a long time.
Life is short. I don’t want to pursue what I can’t see. I just want to catch what I can see.
I amSay, thank you for reading. If it helps you, please like it and forward it. Thank you.