"Refactoring Learning" 04 Reconstruction and design pattern

Source: Internet
Author: User

Well, the fifth chapter of the book, "Refactoring," is a description of the writing structure of some concrete refactoring techniques that are about to be written, and nothing important.

As if to celebrate New Year's Day holiday, specially prepared for me chapters, in order to let me complete today's task and deliberately water a chapter.

Well, there's one important thing: Design pattern refactoring provides the goal, and refactoring is the way to get there.

Here is my nonsense, the great God Mo laughs:

What if you don't understand the design pattern? It doesn't matter, even if you don't understand.

Because many people learn the design patterns will forget, sometimes because they do not, so forget. Sometimes it is because of the use of more, so forget.

If it is the latter that is no recruit wins the realm, if the former that is likely for one reason: read a lot of books and get dizzy.

Design mode This thing is not difficult to say, it is not easy to say simple.

The so-called 23 classic design patterns are summed up, just like 23 sets of sword,

If you master the true meaning of the Sword: object-oriented programming ideas,

In fact, these 23 sets of sword is only a simple trick of an induction, completely do not need to remember.

Well, object-oriented programming thought space-wide, I said the above is purely to install B, if there is a novice to see my blog, it is not feel I am the god? └ (^o^) ┘

Well, as you can see now the reward of this place (if you haven't seen design mode yet)

As a meal, I give you this side of the side of a question, to understand, then the design pattern actually does not need to remember

  • Why is there an interface? Why do you see some people write the code inside, there is a function it does not go directly to call and use the interface to go to call?
  • Why do object-oriented all inherit this play?

In this two simple question, all design patterns are an extension of the two simple questions.

The only purpose is to write code that is extensible, easy to reuse, concise, logically clear, and look at the solid five principles. Maybe that's enough.

Okay, play the game.

"Refactoring Learning" 04 Reconstruction and design pattern

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.