Introduction to ASP.NET MVC4
Microsoft’s ASP .NET MVC4 webpage describes it as “a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP .NET and the .NET Framework.”
As mentioned in a previous entry, the .NET Framework is a powerful and easy-to-use software development tool, and the ASP. NET MVC 4 takes that even further, bringing modern default project templates, new templates for mobile projects, and recipes to customise the code generation.
ASP .NET MVC in general was developed to be a powerful and intuitive framework that gives full control to the developer, while making it simple enough to make development agile and simple, and developers can create dynamic websites or applications.
The ASP .NET MVC Framework allows a .NET developer to create web applications as compositions of three roles: model, view and controller (which represents the MVC in the title). A model is the representation of a state of an aspect of the application, while a controller deals with the interactions and also updates the model, and passing the information to the view. The view accepts the necessary information and then produces a user interface (UI) to display it.
The ASP .NET MVC source code was released in April 2009 under the Microsoft Public License (MS-PL), and the Framework is lightweight and highly testable, integrated tightly with the features from the existing ASP .NET.
By using interface-based contracts, the Framework allows each component to be independently tested, or as Scott Guthrie, vice president of the Microsoft Developer Division, puts it: “It helps enforce a clean separation of concerns between the models, views and controllers…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.”
Earlier this year, Microsoft released its web stack, which included ASP .NET MVC under an open source licence called Apache License 2.0. Scott Guthrie wrote on his blog that “doing so will enable a more open development model where everyone in the community will be able to engage and provide feedback on code check-ins, bug fixes, new feature development, and built and test the products on a daily basis using the most up-to-date version of the source code and tests.”
ASP .NET MVC became known back in December 2007 as a consumer technology preview (CTP), although version 1.0 wasn’t released until March 2009. Since then there has been a new release every year, with 2.0 coming out in March 2010, 3.0 in January 2011, 4.0 developer preview in September 2011, and the 4.0 beta in February 2012.
There are a number of benefits to the ASP .NET MVC Framework, one of which is the fact that it is very extensible and pluggable, with everything being designed so that it can be customised and/or replaced. For developers, this means the ability to connect their own routing policy or view engine and test things that way. In essence, people who develop web or mobile applications using the MVC approach can use the ASP .NET MVC Framework with ease, as it is designed to be clean, uncluttered and intuitive, and one of the main advantages is its ability to separate the concerns i.e. test components individually, which should facilitate improved coding and thus improved applications – which benefits developers and users.
Microsoft is so convinced of the simplicity of ASP .NET MVC4 that it even has, on the website, a tutorial to follow to create your own app. Such a tutorial makes it possible for novices to get involved and start creating too, and with a successful first application developed in a hopefully painless manner, Microsoft no doubt hopes to encourage new people with little to no experience to start developing on the ASP .NET MVC 4 Framework too.