[Reconstruction learning] 04 reconstruction and design mode, Reconstruction Design Mode
Well, the fifth chapter of refactoring is mainly a description of the writing structure of some specific refactoring techniques to be written, and there is nothing important.
It seems that it is a chapter specially prepared for me to celebrate the New Year's Day holiday, and a chapter specially designed for me to complete today's task.
Well, there is another important thing: The Design Pattern provides a goal for refactoring, and refactoring is the way to reach.
The following is my nonsense:
If you do not understand the design pattern? It doesn't matter, even if you don't understand it.
Because many people forget the design pattern, sometimes they forget it because they don't need it. Sometimes I forget it because I used more.
If it is the latter, there is no way to win or win, and if it is the former, it is likely to be caused by one reason: I was dizzy after reading a lot of books.
It is not difficult to say the design pattern.
The so-called 23 classic design patterns summarized are like 23 sets of swords,
If you have mastered the true meaning of the jianfa: Object-oriented programming ideas,
In fact, these 23 sets of swords are just an induction of simple tactics and do not need to be remembered at all.
Well, the object-oriented programming ideology is so extensive in space that I simply want to install B. If a newbie looks at my blog, doesn't I feel like I am a great god? Round (^ o ^) round
Okay, as you can still see the rewards for this place (if you haven't seen the design pattern yet)
As a big dish, I want to give you a question about this small dish. If you want to understand it, you don't need to remember the design pattern.
- Why is there an interface? Why do you see a function in the code written by some people that does not directly call it and calls it through an interface?
- Why do object-oriented methods support inheritance?
In fact, all the design patterns are an extension of these two simple problems.
The only purpose is to write code that is highly scalable, reusable, concise, and logically clear. It may be enough to look at the Five Principles of SOLID.
Okay, I went to play the game.