Common example, when placing an order in a shopping mall, there will be 3 to 5 or more tables associated with the order.
In the MVC pattern, in the case of a single
is to create a template for each table, and then call each model when you place an order
or the next step. Write only one model, then modify each table
Maybe the problem is a little low, but there is no way, I am not enough of the model abstraction ability.
Reply content:
Common example, when placing an order in a shopping mall, there will be 3 to 5 or more tables associated with the order.
In the MVC pattern, in the case of a single
is to create a template for each table, and then call each model when you place an order
or the next step. Write only one model, then modify each table
Maybe the problem is a little low, but there is no way, I am not enough of the model abstraction ability.
It is better not to manipulate the data model at this time, but to operate on the logical model.
In other words, the data model is still a model corresponding to a table. In the data model and controller, and then insert a logical model (logic model), through the logical model (logical models to manipulate multiple data models) to complete a number of logical operations (such as single, etc.).
This will ensure the clarity of the overall architecture.
Look at my answer.
https://segmentfault.com/q/1010000003849810/a-1020000003851204