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.