Common terminology for PHP-oriented objects

Source: Internet
Author: User

  • Class − Defines the abstract nature of a thing. The definition of a class contains the form of the data and the manipulation of the data.
  • Object − is an instance of the class.
  • Member variable − A variable defined inside a class. The value of the variable is not visible to the outside, but can be accessed through member functions, which can be called properties of an object after the class is instantiated as an object.
  • member functions − defined within a class, can be used to access the data of an object.
  • Inheritance − inheritance is the mechanism by which subclasses automatically share data structures and methods of the parent class, which is a relationship between classes. When defining and implementing a class, it can be done on top of an already existing class, taking the content defined by the existing class as its own content, and adding a number of new content.
  • Parent class − A class is inherited by another class, which can be called a parent class, or a base class, or a superclass.
  • Subclass − A class inherits other classes, called subclasses, or derived classes.
  • Polymorphism − polymorphism refers to the same operation or function, the process can be used on multiple types of objects and obtain different results. Different objects, receiving the same message can produce different results, a phenomenon known as polymorphism.
  • Overload − Simply put, the function or method has the same name, but the argument list is not the same case, such a different parameter of the same name between the functions or methods, called each other overloaded functions or methods.
  • Abstraction − abstraction is the abstraction of objects that have consistent data structures (attributes) and behaviors (operations) into classes. A class is an abstraction that reflects the important nature of the application and ignores other extraneous content. The division of any class is subjective, but it must be related to the specific application.
  • Encapsulation − encapsulation refers to the binding of the properties of an object in the real world to the behavior and placement within a logical unit.
  • constructor − used primarily to initialize an object when an object is created, that is, to assign an initial value to an object member variable, always with the new operator in the statement that creates the object.
  • destructor − the destructor (destructor), in contrast to the constructor, automatically executes the destructor when the object ends its life cycle (for example, the function where the object is already called). Destructors are often used to "clean up" work (for example, to open up a memory space with new when creating objects, and to release them in a destructor before exiting).

Common terminology for PHP-oriented objects

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.