The first chapter:
This chapter mainly discusses what is object-oriented, on the basis of object-oriented understanding, and then discusses some advanced topics, such as: Design patterns.
Therefore, this chapter has the following topics:
1) understand what object-oriented programming is.
Before learning to design patterns, it is best to do an in-depth study of Python, lay the groundwork, and understand the object-oriented design concept of Python.
In the object-oriented world, there are two kinds of attributes and methods, and the main method is to manipulate the attributes.
Packaging:
As opposed to the outside of class, class has some behavior that needs to be hidden inside, not public, which is encapsulation.
The principle of object-oriented (class or object) is that the method is open (extensible) and closed (most should not be modified). If this principle is achieved, it is perfect.
Think about it, if you need to expand it, expand it directly, and the original code, no need to modify, how great.
2) Discuss object-oriented design principles
A) the Open/close principle
b) The inversion of control principle (also called Dependency Injection, IOC)
Reference: http://www.cnblogs.com/liujianzuo888/articles/5847569.html
c) The interface segregation principle: interface Isolation principle
3) Understand the concept of design patterns and their classification
4) Discuss the mode of dynamic language
5) Some typical design patterns: creational pattern, structural pattern, and behavioral pattern
Python Design pattern Learning (2): What is design mode