Python Design pattern Learning (2): What is design mode

Source: Internet
Author: User

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

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.