Python learning notes (14) Python class (1), learning notes python class
Basic Concepts
Problem Space: The problem space is the full understanding of a problem. It is composed of the information contained in the problem and the stored information.
Initial status: incomplete information or unsatisfactory status at the beginning;
Target status: the desired information or status;
Operation: steps you may take to move from the initial state to the target State.
Object is a term in Object Oriented. It represents a specific thing in the Namespace of the objective world, it also represents the basic elements in the software system solution space.
Object: an object has its own State, behavior, and unique identifier. The structures and behaviors of all objects of the same type are defined in their common classes.
State: includes the existing attributes of the object (usually defined in the class) and the current attribute values of the object (these attributes are often dynamic)
Behavior: it refers to how an object affects the outside world and is influenced by the outside world, as it changes its State and transmits information.
Identity: an object has different attributes from all other objects. (Essentially the address of the object created in the memory)
Generally speaking, an object should have at least two contents: one attribute (State) and one method (behavior ).
Object-oriented: Object-oriented programming (OOP) is a type of programming model and a method for program development. An object refers to a class instance. It uses objects as the basic unit of a program and encapsulates programs and data.
To improve software reusability, flexibility, and scalability.
Class: in Object-Oriented Programming, class is a construction of an object-oriented computer programming language and a blueprint for creating objects, describes the common attributes and methods of the created object.
Basic Methods for writing classes"
Class Name:
Attribute
Method