Introduction to ASP.NET MVC (Part two)

Hello internet,

Last time, we said that ASP.NET MVC is simply applying MVC architecture to an ASP.NET Web App/Website. In addition to that, we listed some of the main features of MVC 1.0 and 2.0. (You can always check out my post here)

Without any more delays, let’s now talk a little bit about MVC 3.0

MVC 3.0:

Built on top of its ancestors (V1.0 and V2.0), ASP.NET MVC 3 added some great features allowing developers to create scalable and standards-based Web pages implementing a well-designed architectural pattern. This version included:

  • Extensible Scaffolding with MvcScaffold integration: Meaning that you are able to generate a basic customizable outline of your software whether you are a newbie or a professional ASP.NET software developer. (check out Steve Sanderson’s post series for more information)
  • HTML 5 enabled project templates: The ability to add HTML 5 version of project templates leveraging Modernizr’s “detects” to support HTML 5 and CSS 3 in down-level browsers.
  • The Razor View Engine: Clean, concise and easy to learn, it was used instead of Web Forms engine previously adopted in ASP.NET MVC 1 & 2. (Go and check ScottGu’s post if you want to know more)
  • Support for Multiple View Engines: In this version, you had the ability to choose from different view engines such as Web Forms, Razor or Open-Source view engines (Spark, NHaml or NDjango)
  • Controller Improvements: Such as Global Action Filters, new ViewBag properties and ActionResult types.
  • JavaScript and Ajax improvements: The use of unobtrusive JavaScript, meaning that there was no inline injection into HTML, keeping it smaller and making JavaScript libraries’ customization an easy task to perform. (For more information, you can check out Brad Wilson’s Unobtrusive JavaScript post).
  • Model Validation Improvements: Along with supports for DataAnnotation metadata attributes like DisplayAttribute, we saw the improvement of ValidationAttribute class in the .Net Framework 4, in the sense that a new IsValid overload provided more information about the current validation context. In other words, you were able to validate the current value based on another property of the model. Finally, two important validation interfaces were added to the stack (IValidatableObject & IClientValidatable).
  • Dependency Injection Improvements: Better support for applying Dependency Injection and integration with Inversion of Control containers. This support covered many areas such as Controllers, Views, Action filters, Model binders, Model validation providers, Model metadata providers and value providers. (For more information on DI in MVC 3, see Brad Wilson series on Service Location)

These were the most important additions in MVC 3, however this list is not complete and there were many other features included like the NuGet package manager that is still to be considered one of the greatest tools in Visual Studio since it helps developers to find, install and use .NET libraries and tools in their projects. Page Output Caching was also improved allowing programmers to partially and easily cache regions of a response. Finally, Template Scaffolding knew some enhancement, especially in dealing with primary-key properties on models and how to handle them.

MVC 4.0:

Reaching a stable and mature state, ASP.NET MVC 4 was used in more advanced programming. It included:

  • ASP.NET Web API: One of the greatest features of this version that allowed developers to create HTTP services reaching out a large spectrum of clients. In other words, MVC 4 included new project template “Web API” for building HTTP services on top of MVC framework. This is a lightweight service and can return JSON, XML data or Form URL-encoded formats. Services have broad reach of clients including browsers, mobile devices, tablets or even TV set up boxes. ASP.NET web API is also an ideal platform for building self-hosted RESTfull services.
  • Display Modes: Depending on the browser making the request, the Display mode selects views to be provided accordingly (Mobile or Desktop).
  • JQuery Mobile and Mobile Features.
  • Task Support for Asynchronous Controllers: Writing asynchronous action methods as single methods which return Task or Task object type.
  • Azure SDK: Supports for the 1.6 and newer releases of Windows Azure SDK.
  • Bundling and Minification: Enabling developers to minimize HTTP requests needed by a Web page. This mechanism was allowed through the combination of individual files into a single, bundled file for scripts and CSS. Thus, improving request load time. (For more information you can see Bundling and Minification)
  • Supports for OAuth and OpenID enabling logins from Web 2.0

Again, this list of features is not exhaustive, but you can always check Microsoft docs for more details.

That’s enough for this post, next time we will be dealing with our last section in this introduction, which will be about ASP.NET MVC 5.

Goodbye Internet!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Powered by

Up ↑