It is to integrate the other three layers in the project into the model
某草草2017-05-16 17:07:52
I personally think that if you need to extract the original business logic code or the complex business logic code to be implemented separately into a class library.
MVC mainly solves the separation of view, model and user control. In actual business scenarios, it may involve more complex logical processing, such as multi-table joint query, transaction process processing, etc. These complex, relatively independent, view-independent business logic codes can be extracted into separate class libraries to provide external interfaces. Called through dependency injection or direct reference in MVC. The M in MVC just plays the role of a domain model, which may be better.
某草草2017-05-16 17:07:52
When I saw this question being asked, I wanted to say: "Idiot, idiot, what kind of JB question are you asking?" However, after thinking about it, I feel that no matter what, I should be tolerant. Here, I want to ask You, what is the business logic or foundation you are based on? Why do this? What do you think are the benefits of doing this? From this, we can analyze and answer your thoughts. Otherwise, most people don’t want to answer questions without context, especially those who work in technology. They often want to get a reason, and they will naturally think it is unreasonable. I'll scold you. Alas, let’s not talk about the following. Let me mention one thing here. If the other three layers are put into the model, it will not be called model, and it will not be called MVC. As for the situation, I can’t describe it.
漂亮男人2017-05-16 17:07:52
Integrate the other three layers in the project into the model. What’s the point of layering this way
大家讲道理2017-05-16 17:07:52
Oh, if you do this, you don’t need to layer it. Why do you still need MVC...
phpcn_u15822017-05-16 17:07:52
2B, you still ignore it, can you ask clearly?