The confusion of inter-organization calls between class classes during PHP development.

Source: Internet
Author: User
Some open-source MVC frameworks are often used in projects. Directly to the business, a module is built with a controller.
Take thinkphp, if I want to create a new interface, then where should I put this interface in which directory? It's a headache.

As an example,
If I was writing a httpclient PHP class library. I don't know what the angle of the analysis is good: I should create several class files, which files should be in what kind of directory. I look at other people's code, some directories called service, some directories called LIB, and some directories are called class or include what. I do not know what the principles of this document design can be said not.

The class library code that someone else has written looks very nice, and the calls between classes are very elegant. I don't think I can do it well. But I don't know how to master this ability. Is it related to modeling?

Reply content:

Some open-source MVC frameworks are often used in projects. Directly to the business, a module is built with a controller.
Take thinkphp, if I want to create a new interface, then where should I put this interface in which directory? It's a headache.

As an example,
If I was writing a httpclient PHP class library. I don't know what the angle of the analysis is good: I should create several class files, which files should be in what kind of directory. I look at other people's code, some directories called service, some directories called LIB, and some directories are called class or include what. I do not know what the principles of this document design can be said not.

The class library code that someone else has written looks very nice, and the calls between classes are very elegant. I don't think I can do it well. But I don't know how to master this ability. Is it related to modeling?

Discussion on the comment on the continuation of the question

The first one I thought of was
"Code Encyclopedia"
But the book is very thick, if you want to be simple and easy to understand can also see
"Head First design Patterns" (in layman's mode)

You may need to know a little bit about Java

This is the legendary OOP, to see the theory of no great use, do the project to summarize their own, to do complex projects, the need for constantly changing projects, only to know the meaning of oop.

  • Related Article

    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.