tp is a framework of MVC pattern, but why do I rarely use M when developing projects or watching many tp teaching videos? I myself have been writing code in V and C. When should I write in M? Thanks for the answer
tp is a framework of MVC pattern, but why do I rarely use M when developing projects or watching many tp teaching videos? I myself have been writing code in V and C. When should I write in M? Thanks for the answer
In the conventional MVC framework, the M layer should be responsible for most of the data operations. If the business logic is used, the EVENT layer under TP should be better used. At this time, the business logic will be placed in the event layer, and then the model The layer is responsible for more atomic data operations, improving code reuse and development efficiency
Because those tutorials put all curd in the C layer, only used the automatic verification, automatic completion and other functions of the M layer, and did not extract the data operations to the Model