_php tutorials on the learning experience of PHP interfaces shared by programmers

Source: Internet
Author: User
   Fire Building Station College (bkjia.com) network programmingRecently learning PHP5 interface in the process of encountering difficulties, the book is a way to achieve multiple inheritance, but I still do not know how to achieve the specific. In the online check PHP interface data is very few, the Java, in fact, basically almost. After reading the "Clarification Java (interface and inheritance)" This article suddenly dawned on me, originally I understand in error, so-called multiple inheritance refers to the interface inherits the class, but not the class inherits the interface.

The article refers to Oo abstraction, as the article in the sentence-"abstraction is the part of the smoke", very image, the previous thought that the abstract is always difficult to understand, abstract, haha, now it is easy to understand, which is the interface and abstract class to do things.

There are many points in the article that have benefited me, as listed below:

The essence of Oo, I think, is the abstraction of an object.

The function of the interface, Word, is the category of the Flag class (Type of Class). By attributing different types of classes to different interfaces, you can better manage them.

The meaning of inheritance also lies in abstraction, not code reuse.

After reading this article, now basically understand the interface, abstract class, inherit how to apply.

The original text reads as follows:

Clarifying Java (interface and inheritance) the brother of the Institute of Computer Science and I discussed Java, a meeting, a few questions are all about the interface, what is the use of interfaces? Why use an interface? When should I use an interface? I'm glad they're not asking me. How Java connects to SQL Server, or how to develop the EE application, this kind of problem has the lethality, avoids the auspicious. This year the computer college undergraduate has a graduation project is to do J2ME, choose this topic students at the end of May are still suffering face research java.util.* this bag, this ... Alas.

Most people think that the meaning of an interface is to replace multiple inheritance. It is well known that Java does not have multiple inheritance mechanisms like C + +, but it can implement multiple interfaces. In fact, this is very far-fetched, interface and inheritance is a completely different thing, interface does not have the ability to replace multiple inheritance, nor this obligation. The function of the interface, Word, is the category of the Flag class (Type of Class). By attributing different types of classes to different interfaces, you can better manage them. The essence of Oo, I think, is the abstract of the object, the most can reflect this is the interface. Why we discuss design patterns are only for the language with the ability to abstract (such as C + +, Java, C #, etc.), because the design pattern of the study, in fact, is how to reasonably abstract. (Cowboy's famous saying is "Abstraction is the part of the drawing of the image", seemingly ridicule, rationale).

The most basic of the design pattern is the Factory mode (Factory), in my recent very simple application, I want to try to let my program can be migrated across multiple databases, of course, this involves a lot of problems, just how to compatible with different DBMS SQL is a headache. We might as well start by simplifying the problem and only consider how to connect the different databases.

    • Total 2 Pages:
    • Previous page
    • 1
    • 2
    • Next page

http://www.bkjia.com/PHPjc/364210.html www.bkjia.com true http://www.bkjia.com/PHPjc/364210.html techarticle Fire Station College (liehuo.net) network programming recently encountered difficulties in the process of learning PHP5 interface, the book said is a way to achieve multiple inheritance, but I still do not know how to actually ...

  • 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.