AppsLatestNewsTechnologyWebsite

Determining if you should use ASP.NET MVC

ASP.NET MVC was introduced about a decade ago to give developers an alternative way of writing web applications. The move, I guess, was inspired by a long list of open-source frameworks available at the time that used the Model- a long list of open-source frameworks available at the time that used the Model View-Controller (MVC) pattern. ASP.NET MVC, though, was not bad at all and became a powerful development framework for the web from 2010 forward.

The changes coming with ASP.NET Core 1.0 reinforce and confirm this vision. To be a web developer today and tomorrow on the Microsoft stack, you need to master ASP.NET MVC. ASP.NET MVC at a glance ASP.NET Web Forms owed its success to the thick abstraction layer it built over the core web infrastructure. ASP.NET MVC makes a point of doing just the opposite; it makes the same abstraction layer as thin as possible.

Whereas Web Forms aims to shield developers from the details of HTML, CSS, and JavaScript, ASP.NET MVC strives to give developers total control over markup by including HTML, JavaScript, and CSS. ASP.NET MVC uses the controller as the entry point in the server-side chain of tasks that process an incoming request.

As a developer, you have total control over the building of the URL and how it is mapped to a controller. Internally, the controller has access to the surrounding HTTP context—including the session state, request, response, and user information—and it orchestrates the processing of the request. Any results generated by the request processing are delivered back to the controller, which decides about the next step.

The next step involves generating an HTML view, packaging data in JSON or XML format, or delivering anything else the caller expects to receive—for example, binary data. Compared to using Web Forms, the building of the view is a lot trickier because the developer is responsible for just about everything. The often-blamed viewstate in Web Forms actually saved a lot of work for developers. It is not part of ASP.NET MVC, and all the viewstate’s maintenance work now has to be manually coded.

Related Articles

Leave a Reply

Back to top button