Project code hierarchy

Source: Internet
Author: User
I have been engaged in php development for some time. One of the biggest problems I have encountered now is the problem with the tp framework we are currently using, that is, the larger the model, the larger the Model. now I want to split the model, but I don't know how to do it... I have been engaged in php development for some time.
One of the biggest problems encountered now is about Project layering.
The tp framework we are using now
The problem is that the model is getting bigger and bigger.
A Model may have one thousand rows.
Now I want to split the model.
But I don't know how to do it.
Are you experiencing this situation again?
Or how are other frameworks layered?

Reply content:

I have been engaged in php development for some time.
One of the biggest problems encountered now is about Project layering.
The tp framework we are using now
The problem is that the model is getting bigger and bigger.
A Model may have one thousand rows.
Now I want to split the model.
But I don't know how to do it.
Are you experiencing this situation again?
Or how are other frameworks layered?

Add, delete, modify, and query databases at one layer
Data Cache Layer
Business logic layer

Decoupling. Split Based on different functions.

A model has 1000 rows. It is enterprise-level development. enterprise-level development does not support caching. After all, data is changeable and everyone sees different things.
In addition, you really think that 1000 rows are very good. Look at the ecshop type. A file with 3000 or 4000 rows is also running, but people are doing cache.
The performance of xcache is not that bad for older php versions.

Abstract Logic, decoupling function; TP current version also provides a Model, Service, Logic Solution

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.