Problems with the data model

I am a phper, who encountered a problem during the development process.
the pattern we developed is MVC. The model layer, that is, object-relational mapping, is used. A project generally has several modules, such as: user module, permissions module.
obviously, both the user module and the permissions module use the user table. So is it better for me to build a separate model in each module or to share a model?

Php
Mar.31,2021

generally speaking, this is a very contradictory place. On the one hand, we emphasize modularization, one module is well written, and other businesses are called. This is very convenient, and it can also reduce the amount of code and improve efficiency, but doing so will form a high coupling and start the whole body. At this point, it depends on your business logic. If your business rarely changes after it has been developed, at least not overturning the underlying rewriting, then high coupling, writing it into a model and calling it uniformly. If your modules themselves are in conflict, or if your leadership is fickle and do it again every day, then you can only reduce the coupling and write model separately


. There is no doubt that the whole must be independent. Depending on your business requirements, you can call each other last time, and orm can use associated design

.
Menu