Object-oriented Thinking, object-oriented
Object-Oriented Programming (Object OrientedProgramming, OOP, Object-Oriented Programming) is a computer programming architecture, one basic principle of OOP is that a computer program is composed of a single unit or object that can act as a subroutine. OOP achieves three objectives of Software Engineering: reusability, flexibility, and scalability. To achieve the overall operation, each object can receive, process, and send information to other objects.
Some specific operations need to access and assign values to the encapsulated types. In this case, we need other functions to help us complete these operations. PHP provides us with a method name:
_ Set (), _ get ()Encapsulate keywords: public, protected, private encapsulate related functions :__ set (), _ get () public indicates global, and internal and external subclass of the class can be accessed; protected indicates protected, only this class, its subclass, or its parent class can be accessed. private indicates private and can only be used within this class;
Class concept: A class is a set of objects with the same attributes and services. It provides a unified abstract description for all objects belonging to this class, which includes two main parts: attribute and service. In an object-oriented programming language, a class is an independent program unit. It should have a class name and contain two main parts: attribute description and service description.
Object: an object is an entity used to describe objective things in a system. It is a basic unit of a system. An object consists of a group of attributes and a group of services that operate on these attributes.