Is ASP.NET MVC more than just new cool technology? What advantages it brings over ASP.NET Web Forms? When should I use ASP.NET MVC and when ASP.NET Web Forms? How do I MVC this and MVC that?
This the first post in series of posts that should help me as an architect to answer these questions. It is based on and digested from ASP.NET MVC Overview.
ASP.NET MVC Overview
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller.
- Models. Model objects are the parts of the application that implement the logic for the application's data domain.
- Views. Views are the components that display the application's user interface (UI).
- Controllers. Controllers are the components that handle user interaction, work with the model, and ultimately select a view to render that displays UI.
Advantages of an MVC-Based Web Application
- It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.
- It does not use view state or server-based forms.
- It uses a Front Controller pattern that processes Web application requests through a single controller.
- It provides better support for test-driven development (TDD).
- It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.
Advantages of a Web Forms-Based Web Application
- It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development.
- It uses a Page Controller pattern that adds functionality to individual pages.
- It uses view state or server-based forms.
- It works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development.
- In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than the MVC model.
This post is made with PracticeThis.com plugin for Windows Live Writer