Python is a kind of Oriented-Object Programming, which is a programming paradigm which is built on the concepts of class, inheritance, object.
Class is a collection of the features, properties of an object. For example, tree is a broad definition, containing all the features of tree, such as color, size and shape.
Object is an example of class. For instance, tree define all the characteristics of tree around the world, and Tina is a specific example tree, which has its unique shape of leaves and unique color of leaves. The difference between class and object likes the relationship of the set of Z and "1" in math.
Inheritance is a concept that there is a sub-class in a class. For example, tree is a wide definition and may has its sub-class, such as pine tree and maple tree. Tina may be a sort of pine tree which inherits properties and behaviors of its parent class and may have its own properties and behaviors.
Message passing means that object implement a function through receiving a message or dealing message. It likes a series of reactions when leaves fall.
By and large, Oriented-Object Programming collects and save all the information and operations into the program.
没有评论:
发表评论