Model View Controller architecture (or pattern) allows us to separate different parts of our applications into tiers to fulfill this need.
ASP.NET MVC is a free and fully supported Microsoft framework methodology that divides an application’s implementation into three component roles: models, views, and controllers for building web applications.
ASP.NET MVC provides the following benefits:
- Provides complete control over your HTML markup.
- Enables rich AJAX integration.
- Clean website URLs (SEO friendly urls).
- Clear separation of concerns which results in web applications that are easier to maintain and extend over time.
- Testability – including support for test-driven development.
M for “Model”: It represents the data of the Database functionalities.
Ex. Create Sales, Get Sales, Edit Sales, Delete Sales
V for “View”: it handles flow of the application user interface of the pages with
Ex. Edit.aspx page, Create.aspx Page
(Textbox, Checkbox, button, etc.)
Note: view displays only information of user interface.
C for “Controller: it takes care of presentation of the end user interaction. It will interact with model and view and respond to user input requirement.
MVC is a clean separation between the data model and the user interface in such a way that changes to the user interface don’t affect data handling.
Advantage of an MVC-Base Web Application
The ASP.NET MVC framework offers the following advantages:
- 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. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
- It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure.
- It provides better support for test-driven development (TDD).
- It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.