MVC is a template where the responsibility for displaying data is delegated to Component View, the user processing responsibility and input system are delegated to controller components, and the responsibility for processing business logic and data is delegated to model components. ASP.NET MVC is an implementation of the MVC template for ASP.NET web programming.
ASP.NET MVC complies with ASP.NET WebForms, where a clear separation of duties is not expected (although good projects often try to use an MVC-like design). In WebForms, typically rendering viewing, processing I / O (web requests), and business logic responsibilities are often mixed between label and code on ASPX pages. For example, in WebForms, you can embed SqlDataSource with selection logic directly in your label and bind it to the GridView. It is very difficult to verify that the selection logic works using unit tests. In ASP.NET MVC, data selection will be handled by a controller action that generates view data that will be transmitted and displayed in the view. The correct operation of this controller action (this is just a method on the controller class) can be much more easily verified using unit tests.
ASP.NET MVC uses REST-based URLs, not the WebForm PostBack model, to interact with the user. MVC can use any HTTP method, with the standard expectation that RESTful URLs are the norm. WebForms typically only uses GET / POST methods.
Although ASP.NET WebForms is relatively mature and has several controls designed for it, including third-party controls, ASP.NET MVC is still in beta (starting on 12/2008) and has far fewer controls available. Some argue that this is perfectly acceptable, as one aspect of MVC is to give the developer more control over the rendering of the view. Others may find this a serious flaw and may wish to wait until additional controls that work with the MVC model are developed.
For comparisons with other languages โโ/ frameworks, among others, see Ruby on Rails (Ruby), Java Struts or Spring MVC (Java), and Django (Python).
source share