This entry is part 1 of 4 in the series ASP.NET - WebForms versus MVC

The goal of web-development is to build web-forms fast – and build web forms that are testable. There are currently two competing technologies for building web-forms – Classic ASP.NET (WebForms) – and MVC (ASP.NET MVC) – which is radically different from WebForms. WebForms win hands-down in terms of rapidity of development. MVC wins when it comes to writing tests and providing code coverage for the web forms.  In this series, we explore ASP.NET MVC in detail – and provide insight into whether it makes sense to adopt this technology for your next web application.

Goals of the MVC framework

Some of the stated goals of the framework are:

  • Enable clean separation of concerns
  • Be testable by default
  • Support Inversion of Control (IoC) containers and third-party view engines
  • Support customization of URLs
  • Leverage existing ASP.NET features
  • Support static and dynamic languages

Ingredients of MVC

Models, views, and controllers.

  • "Models" in a MVC based application are the components of the application that are responsible for maintaining state.  Often this state is persisted inside a database (for example: we might have a Product class that is used to represent order data from the Products table inside SQL).
  • "Controllers" in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.  In a MVC application the view is only about displaying information – it is the controller that handles and responds to user input and interaction.
  • "Views" in a MVC based application are the components responsible for displaying the application’s user interface.  Typically, the model data is used for creating this UI (for example: we might create an Product "Edit" view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object).

Key Benefit of MVC

One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application.  Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.

The MVC pattern can also help enable red/green test driven development (TDD) – where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.



Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.


Series NavigationBuilding Rapid, Testable Web-Forms–Hello World with ASP.NET MVC