How to structure an enterprise MVC app, and where does Business Logic go?

前端 未结 8 1470
夕颜
夕颜 2020-12-12 15:05

I am an MVC newbie. As far as I can tell:

  • Controller: deals with routing requests
  • View: deals with presentation of
8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 15:43

    IMO this scenario is more suited to something like you'd use in WPF. ViewModel View Controller.

    Your controller talks to the business services that perform functions on domain objects. The controller converts data returned from the business services (combining several if needed) into View Models (the "M" in MVC). The View Model is then passed to the View.

    The same in reverse to take VM's from the view and sending the data back to the business services

提交回复
热议问题