What is MVC?

Updated on     Kisan Patel

ASP.NET MVC is the eagerly anticipated revision of Microsoft’s approach for creating data-driven dynamic applications. MVC is Model-View-Controller. Model-View-Controller, architecture for building interactive applications that lies at the heart of the Rails framework. The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications.

The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. ASP.NET MVC is a framework for building web applications that applies the general Model View Controller pattern to the ASP.NET framework. Let’s break that down by first looking at how ASP.NET MVC and the ASP.NET framework are related.

When ASP.NET 1.0 was first released in 2002, it was easy to think of ASP.NET and Web Forms as one and the same thing. ASP.NET has always supported two layers of abstraction, though:

  1. System.Web.UI: The Web Forms layer, comprising server controls, ViewState, and so on
  2. System.Web: The plumbing, which supplies the basic web stack, including modules, handlers, the HTTP stack, and so on ..

However, there was always the possibility of getting below all that – responding directly to HTTP requests, building out web frameworks just the way you wanted them to work, crafting beautiful HTML – using Handlers, Modules, and other handwritten code. You could do it, but it was painful; there just wasn’t a built-in pattern that supported any of those things. It wasn’t for lack of patterns in the broader computer science world, though. By the time ASP.NET MVC was announced in 2007, the MVC pattern was becoming one of the most popular ways of building web frameworks.

The MVC Pattern
Model-View-Controller (MVC) has been an important architectural pattern in computer science for many years. Originally named Thing-Model-View-Editor in 1979, it means of separating concerns within an application (for example, separating data access logic from display logic) and applies itself extremely well to web applications. Its explicit separation of concerns does add a small amount of extra complexity to an application’s design, but the extraordinary benefits outweigh the extra effort. It has been used in dozens of frameworks since its introduction. You’ll fi nd MVC in Java and C++, on Mac and on Windows, and inside literally dozens of frameworks

The MVC separates the user interface of an application into three main aspects:

  • The Model: A set of classes that describes the data you’re working with as well as the business rules for how the data can be changed and manipulated
  • The View: Defi nes how the application’s user interface (UI) will be displayed
  • The Controller: A set of classes that handles communication from the user, overall application now, and application-specific logic.

MOdel view controller


Leave a Reply