What this article brings to you is about PHP object-oriented. PHP Object-oriented meaning introduced, there is a certain reference value, the need for friends can refer to, I hope to help you.
The meaning is summed up by Baidu.
The key idea of object-oriented programming technology is that it puts the data and the operation behavior of the data together as an interdependent and indivisible whole-object. Classes are formed by classifying and abstracting objects of the same type and drawing common characteristics. Object-oriented programming is the definition of these classes. A class is a collection of objects that describe the same type. After the class is defined, it is used as the data type to create the object for the class. The execution of a program behaves as an interactive communication between a set of objects. Objects communicate with each other through a public interface, thus completing system functions. The public member declared in the class makes up the external common interface of the object
OOP achieves three main goals of software engineering: reusability, flexibility, and extensibility
Process-oriented is a matter of a project decomposition into a small function, with a function to achieve.
Object-oriented is to think of things as a small object, or a small part of the relationship between these objects, constitute the whole project .... Here are two completely different design ideas:
Case:
Come to the guests at home, to boil the tea
Process-oriented design method: A washing cup two boiling water three cups in the tea four water opened, pour boiling water into the cup
Object-Oriented design method: Two objects: Jug Cup
The properties of a cup: material glass, stainless steel, or ceramic
Clean and clean
Cup of event Wash Cup
Kettle of events Burn
Master 2 Why?
What is a class?
A class is a collection of a set of objects that have the same properties and services. It provides a uniform, abstract description of all objects that belong to the class.
In an object-oriented programming language, a class is a separate program unit that should have a class name and include two main parts of the property description and service description .
What is an object?
object is an entity used to describe objective things in the system, which is a basic unit of the system.
An object consists of a set of properties and a set of services that operate on that property.
1. Easy Maintenance
Object-oriented design of the structure, high readability, due to the existence of inheritance, even if the need to change, then maintenance is only in the local module, so maintenance is very convenient and low cost.
2. High quality
At design time, you can reuse existing classes that have been tested in the field of previous projects to make the system meet business requirements and have high quality.
3. High efficiency
In software development, according to the needs of the design of the real world of things to abstract, produce classes. Using this method to solve the problem, close to the daily life and the natural way of thinking, is bound to improve the efficiency and quality of software development.
4. Easy to expand
Due to the characteristics of inheritance, encapsulation and polymorphism, the system structure of high cohesion and low coupling is designed naturally, which makes the system more flexible, easier to expand and less cost.
Related recommendations:
PHP Object-oriented Programming, PHP object-oriented
PHP Object-oriented Programming (ii), PHP object-oriented programming