[Reconstruction learning] 04 reconstruction and design mode, Reconstruction Design Mode

Source: Internet
Author: User

[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.

Related Article

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.