What is an MVC framework and why is it necessary/useful?

前端 未结 9 787
自闭症患者
自闭症患者 2021-02-02 03:01

I know that an MVC framework allows you to separate business logic, data base access and presentation, but why do we need a framework to do this.

Can\'t we just keep ou

9条回答
  •  逝去的感伤
    2021-02-02 03:24

    In my opinion the thing you are talking about is the MVC pattern and not a specific framework. Of course you can go and keep all your classes within one project and still use the MVC pattern, as you have all your UI code in the views, the logic in the controllers, ...

    A MVC framework on the other hand makes it easier for you to use this pattern. It may provide some base classes for controllers and a mechanism for the communication between view and controller.

    I don't know if you are familiar with ASP.NET MVC. The framework itself is very small, but it helps you developing an application with the MVC pattern, as you don't have do think about the previously decribed areas...

    Hope this helps

提交回复
热议问题