Ec (2); 1. object-oriented concepts 2. What is class, what is object, the relationship between class and object 3. What is object-oriented programming? 4. How to abstract a class? 5. How to instantiate an object? 6. How to Use members in an object? 7. special reference & ldquo; $ this & rdquo; 8. constructor and constructor 9. encapsulation 10. application of the following four methods: _ set (), _ get (), _ isset (), and _ unset () 11. class inheritance 12 script ec (2); script
1. object-oriented concepts
2. What is a class, what is an object, and the relationship between a class and an object
3. What is object-oriented programming?
4. How to abstract a class?
5. How to instantiate an object?
6. How to Use members in an object?
7. Special Reference to the use of "$ this"
8. constructor and constructor
9. Encapsulation
10. _ set (), _ get (), _ isset (), and _ unset ()
11. class inheritance
12. Application of Polymorphism
13. Reload the New Method
14. Access type
15. Use of static members
16. Application of final keywords
17. _ toString () method
18. Clone object
19. _ call handle call errors
20. automatically load the class
21. serialize objects
22. Abstract methods and abstract classes
23. php5 Interface Technology
1. object-oriented concepts
Object-Oriented Programming (Object Oriented Programming, OOP, Object-Oriented Programming) is a kind of computer Programming.
A basic principle of OOP is that a computer program is composed of a single unit or object that can act as a subroutine.
Three goals of software engineering are achieved: reusability, flexibility, and scalability. Each object can receive
Information, processing data, and sending information to other objects. Object-oriented has always been a hot topic in the software development field. First,
Object orientation conforms to the general rules of human beings in view of things. Second, the use of object-oriented methods can make all parts of the system perform their respective duties
Do your best. Open a door for programmers to make their programming code more concise, easier to maintain, and more reusable
Usability. Some people say that PHP is not a real object-oriented language. This is a fact. PHP is a hybrid language. You can
With OOP, you can also use traditional procedural programming. However, for large projects, you may need to use pure OOP in PHP
Declare the class and use only objects and classes in your project. I will not talk more about this concept, because many of my friends are far away from
The main reason for elephant programming is that it cannot be understood when it comes to object-oriented concepts, so I don't want to learn it anymore. Read
After reading the entire content, you can understand the concept.
2. What is a class, what is an object, and the relationship between a class and an object
Class concept: A class is a set of objects with the same attributes and services. It provides uniformity for all objects belonging to this class.
Abstract description, which includes two main parts: attribute and service. In an object-oriented programming language, a class is an independent process
Sequence 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. I
Objects consist of a group of attributes and a group of services that operate on these attributes. From a more abstract perspective, the object is a problem domain or
Implement an abstraction of some things in the domain. It reflects the information that needs to be stored in the system and its role. It is a group
And the encapsulation body of a group of services that have the right to operate on these properties. The objective world is composed of links between objects.
The relationship between a class and an object is like the relationship between a mold and a casting. The instantiation result of a class is an object, and the abstraction of A Class Object is
Class. Class describes a group of objects with the same features (attributes) and the same behavior (methods.
The above is probably their definition. Maybe you are new to object-oriented friends. Don't be confused by concepts.
Let me give you an example. If you want to buy several assembled PC machines in Zhongguancun, what do you do first?
The engineer is sitting with you and completing an installation configuration ticket with you based on the information you provide.
Like a class, it is a piece of paper, but it records the information of the PC machine you want to buy. If you use this configuration item to buy 10 machines
Then the 10 machines are all composed of the configuration items. Therefore, these 10 machines are of the same type, or
Class 1. So what is an object? The instantiation result of a class is an object. It is configured (instantiated) with this configuration sheet.
Machines and sub-accounts are objects that we can operate on, 10 machines and 10 objects. Each server is independent.
They are of the same type, and no action on one of them will affect the other nine machines, but I modify the class, that is, in
If one or fewer accessories are added to the configuration list, the nine hosts that are installed are changed. This is the relationship between classes and objects (
The instantiation result is an object ).
3. What is object-oriented programming?
If you want to build a computer classroom, you must first have a room with N computers in it,
There are N tables, N chairs, whiteboards, projectors, etc. What are these? We just said, this is the object.
It can be said that the unit of the computer classroom is the entity object, which together constitute this
In the computer classroom, what is the relationship between program and object orientation?