PHP zero-based-object-oriented programming concept

Source: Internet
Author: User

The concept of object-oriented change

There are one by one different ways to think about how to construct an application. An object can be used to encode the display tasks, processes, and ideas that the application handles to implement more appropriate modeling. Instead of considering an application as a control thread that passes a large amount of data from one function to the next, the OOP approach allows the application to be modeled as a set of objects that work together , and these objects can handle certain activities independently.

Spit Groove: And JS quite like the

Advantages of OPP

You can easily convert a single business requirement into a single code module.

Code reuse

The modularity of the class

Spit Groove: Later asked the advantages of OPP that's it

The composition of OPP

Class (Class) A "blueprint" for an object that contains the actual code that defines the properties and methods

Objects (object) a running instance of a class that contains all the content data and state information required for the application to run

Inheritance (inheritance) can define the ability of a type class to be a subtype of different types of classes (like a square is a rectangle)

Polymorphism (polymorphism) allows a class to be defined as a member of multiple class categories (for example, cars are "food with engines" and "Things with Wheels")

Interface (interface) refers to the practice of setting what an object can do without specifically defining these functions (for example: dogs and people are "things that can be walked", but the way they walk varies greatly)

Encapsulation (encapsulation) object's ability to protect access to internal data

Spit Groove: Memorize it, Sao year

And then the code starts down.

PHP zero-based-object-oriented programming concept

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.