Class Concept: A class is a collection of objects that have the same properties and services. It provides a unified, abstract description of all objects that belong to the class, including two main parts of properties and services. In an object-oriented programming language, a class is a stand-alone program unit that should have a class name and consist of two main parts: a property description and a service description.
Object concept: An object is an entity used to describe an objective thing in a system, which is a basic unit of a system. An object consists of a set of properties and a set of services that operate on that set of properties. From a more abstract point of view, an object is an abstraction of a problem domain or something in the implementation domain that reflects the information and the role that the thing needs to be saved in the system; it is a set of attributes and a wrapper for a set of services that have permission to manipulate these properties. The objective world is made up of the connections between objects and objects.
The relationship between a class and an object is like the relationship between a mold and a casting, and the instantiation of a class is the object, and the abstraction of a class object is the classes. The class describes a set of objects that have the same attributes (attributes) and the same behavior (methods). Above is probably their definition, perhaps you are just contact with the object of the friend, do not be confused by the concept of things, give you a column, if you go to Zhongguancun to buy a few assembled PC, to where you first step to do, is not installed engineers and you sit together, According to the information you provide with you to complete an installed configuration single Ah, this configuration can be imagined as a class, it is a piece of paper, but it is recorded on the PC you want to buy information, if you buy 10 machines with this configuration, then these 10 machines, are based on this configuration single, So the 10 machine is a type, it can be said to be a kind of. So what is the object, the instantiation of the class result is the object, with this configuration single configuration (instantiation) of the machine is the object, we can operate the entity, 10 machines, 10 objects. Each machine is independent, can only show that they are the same class, to one of the machines do any action will not affect the other 9 machines, but I modify the class, that is, in this configuration list with one or fewer accessories, then the installed 9 machine has changed, this is the relationship between classes and objects (class instantiation result is the object).
This article is from the "Anping notes" blog, so be sure to keep this source http://anping.blog.51cto.com/10316899/1952679
"Getting Started with PHP object-oriented (OOP) programming" 2. What is a class, what is a relationship between objects, classes, and objects