Course of model learning-lecture on model 23 from book to instructor Li Jianzhong

Source: Internet
Author: User
It took two months to finally finish listening to the lecture on the design pattern.
I feel that my thoughts are the same as those of Uncle Bob's agile development. There is a process of re-sublimation of ideas.


At the beginning of the learning model, like many people, they also bought the gof book of the four-person gang and read it over and over again. However, they only learned that there are 23 models, what we can truly use and understand at that time is the simplest mode of the creation model Singleton. Later, I chatted with netizens and mentioned the big brick of the Java and mode he was reading. I have heard of the book before, but I have never bought it. The online feedback is very smooth, there are not many advantages. But at that time, just like the people who fell into the water, they caught the grass and went to death. So I bought it and read it carefully. After reading the entire article, I learned little about it. I just said that I understand it better than reading a gof book. Why is this model called this name? How to use it? Why. Still confused. At this time, Uncle Bob's Agile Software Development book translated, the online evaluation of translation is very good, and matrin flow master's reconstruction of the translated also, so immediately bought together.

At that time, I thought I should read agile software development first. It took a long time to read Uncle Bob's book carefully and put the five object-oriented development principles mentioned by Uncle Bob:
Single Responsibility Principle SRP: single Responsibility Principle
OCP: Open-Close Principle
Liskov replacement principle LSP: liskov substitution principle
Dependency inversion principle dip: dependency invertion Principle
Interface isolation principle ISP: interface separate Principle

Print it out and paste it on your computer. If it's okay, check it out ..
Uncle Bob didn't explain much about the model, but he described in his book some ideas that benefit you for life.
In the example of the copy, you may not be able to read it carefully.
After reading Uncle Bob's book, he felt that his mind was chaotic and he had an impulse to keep moving. But cannot tell why. The actual project uses what I learned in the book, but it is not a good idea, and will still return to the old road.
After reading Uncle Bob's book, he went on to rebuild it .. At this time, the idea was gradually clarified, recalling some of the experiences and five principles described in Uncle Bob's book.
I gradually realized that refactoring is not useless or correct.Code. He is the result of previous experiences and has the same effect as the model. The pattern is a result obtained by refactoring based on five principles and some development experience. From the book, you can see that it is totally different from your own growth process.

By mistake, I found that Microsoft's webcast has a design pattern explained by Li Jianzhong. Program Design> I paid tribute to the book, so I downloaded the first lecture in the factory model. I felt that I had benefited a lot and immediately downloaded 23 lectures.
In his lectures, he explained the 23 modes, just like in many books. For example, the decoration mode in Java and pattern of macro is described as follows:
He said Sun Wukong has 72 changes, but each change is only a decoration at the time, and the entity is still Sun Wukong. I will not talk about these details, but I will also introduce the classics, but what makes people understand is what kind of decoration mode is, the intention of this model is not clearly stated. Although he also mentioned the use of the model later, it is nothing to say, readers cannot go to the real application model either. (You may have different opinions ).
In the model course explained by Li Jianzhong, we did not explain it in this way. First, he emphasized how the model came from, and second, why should we use it, third, what is the difference between the no-use mode and the code that uses the mode. Fourth: What is the core idea of the model. He asked you to attend lectures with these questions. He doesn't teach you what kind of code is called the decoration mode, and what kind of diagrams is called the decoration mode. In addition, he clearly told the audience that the code and UML class diagrams in the gof23 mode are not standardized. Any intention that matches his pattern can be called pattern. He repeatedly mentioned the following sentence in the course: Isolate changes . I think this sentence is the focus of the model and the goal of restructuring. If you think carefully and have rich project experience, you should be able to deeply understand the meaning of this sentence. This is the essence of the current model. How to isolate changes can be guided by the five principles. Under the guidance of these five principles, you can use refactoring to get a pattern. Er, back to the theme, how did Teacher Li Jianzhong explain? First, he gives the scenario requirements for this model, that is, where you need to apply this model, and what benefits will it bring to you. Of course, this is just a language. Then he will give the gof's Intention about this pattern.
He repeatedly stressed that, after isolating the changes and using the dynamic view mode, he will give you a simple example after repeating the one thousand times. Of course, what he gave you first is that there is no mode. Then he is using a simple refactoring (it cannot be said that, because he has no process, it is used directly, because of the time relationship of the lectures) it gives you a clear understanding of the differences between pattern and pattern. What he emphasizes most is why he wants to introduce this pattern, what problems does it solve? In those situations, we need to introduce this pattern. In those cases, you do not need a pattern. Although his example is very small, he still tries his best to make you feel how he isolates and responds to changes. The central idea he gives you is to isolate changes...
This is emphasized in many books and presented to readers, for example, the purpose of parsing design patterns and so on. However, I personally think that these lectures are wonderful.

I re-read Uncle Bob's agile software development with these ideas. This is my experience later.
About the copy program. Uncle Bob gave me two different versions: process-oriented and object-oriented. At that time, the example is very simple,
When I started reading for the first time, I always only knew that the last version is better than the first version. As for why, I had to answer this question mechanically because the second version is better able to support expansion ..
The second time I was watching it, it was completely another kind of feeling. In the second version, the dependency is completely reversed. Why did he put the dependency upside down. Because he wants to isolate the changes, then there is a change ?? This is the copy part, and I think it is more profound to my understanding:"If there is a change, encapsulate it and form an isolation between the change and the change. This encapsulates changes and isolates changes.". I personally think these words are very accurate to express the essence of the model. By understanding these things in detail, you can understand the application of the model well. With these understandings, when you look back at the design model, you will feel a natural feeling. In the face of the Application Scenario set by the design pattern, you can naturally understand why this pattern is generated and how it solves the problems in this setting scenario ..

I hope you will feel sorry for your inconveniences.

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.