Confusions about the inter-organizational calling of class classes during php development.

Source: Internet
Author: User
Usually, some open source mvc frameworks are used in projects. directly oriented to the business, a module creates a controller. take thinkphp as an example. If I want to create a new interface, which directory should I put this interface in? This problem is a headache. For example, if I... usually use some open-source mvc frameworks in projects. for business purposes, a module creates a controller.
Take thinkphp as an example. If I want to create a new interface, which directory should I put this interface in? This is a headache.

For example
Assume that I am writing an httpclient php class library. I don't know from what perspective it is better to analyze: I should create several class files and which class files should be stored in what directories. I think other people's Code, some directories are called services, some directories are called lib, and some directories are called class or include. I don't know how to design such files.

The class library code compiled by others looks very beautiful, and the calling between classes is very elegant. I feel that I am not doing well. But I don't know how to master this ability. Is it related to modeling?

Reply content:

Usually, some open-source mvc frameworks are used in projects, and services are directly oriented. A module creates a controller.
Take thinkphp as an example. If I want to create a new interface, which directory should I put this interface in? This is a headache.

For example
Assume that I am writing an httpclient php class library. I don't know from what perspective it is better to analyze: I should create several class files and which class files should be stored in what directories. I think other people's Code, some directories are called services, some directories are called lib, and some directories are called class or include. I don't know how to design such files.

The class library code compiled by others looks very beautiful, and the calling between classes is very elegant. I feel that I am not doing well. But I don't know how to master this ability. Is it related to modeling?

Discussion of questions and comments

The first thing I think of is
Code Daquan
However, this book is very thick. You can check it if it is easy to understand.
Head First Design Patterns)

You may need to know a little about Java

This is the legendary OOP. If we look at the theory as useless, We can summarize the project by ourselves. We need to make complex projects and projects with constantly changing requirements to understand the significance of OOP.

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.