A common example is that when a mall places an order, there will be 3 to 5 orders or the MVC mode. In this example, a template is created for each table, then, when the order is placed, call each model or write only one model for the order step, and then modify each table. Maybe this... for example, when a mall places an order, there are 3 to 5 orders or
In the MVC mode, take the order as an example,
Is to create a template for each table, and then call each model when placing an order
Or write only one model for the order step, and then modify the tables.
This problem may be a bit low-level, but there is no way. I am not capable of abstracting models.
Reply content:
For example, when a mall places an order, there are 3 to 5 orders or
In the MVC mode, take the order as an example,
Is to create a template for each table, and then call each model when placing an order
Or write only one model for the order step, and then modify the tables.
This problem may be a bit low-level, but there is no way. I am not capable of abstracting models.
At this time, it is best not to operate on the data model, but on the logical model.
That is to say, a Data Model is a table corresponding to a Model. Insert a Logic Model between the data Model and the Controller to perform logical operations (such as placing orders) through the logical Model (which operates multiple data models ).
This ensures that the overall architecture is clear.
Check out my answer.
Https://segmentfault.com/q/1010000003849810/a-1020000003851204