search

Home  >  Q&A  >  body text

c# - How to write three layers in the model in mvc project

It is to integrate the other three layers in the project into the model

高洛峰高洛峰2817 days ago589

reply all(8)I'll reply

  • 某草草

    某草草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.

    reply
    0
  • 某草草

    某草草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.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 17:07:52

    Haha, I guess the poster has a problem with his expression skills

    reply
    0
  • 漂亮男人

    漂亮男人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

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 17:07:52

    It’s unscientific to do this. MVC is to separate the others.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 17:07:52

    Oh, if you do this, you don’t need to layer it. Why do you still need MVC...

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:07:52

    You are an alien. . . .

    2B, you still ignore it, can you ask clearly?

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 17:07:52

    You can understand the concept of mvc

    reply
    0
  • Cancelreply