Web Application Development with Microsoft Technologies

.NET Technologies Gadgets, Entrepeneour, Experiences and more

Web Application Development with Microsoft Technologies header image 2

New ASP.NET MVC Framework Explained

November 18th, 2007 · No Comments

There is a lot of buzz around about the new MVC framework from Microsoft. This will be an Optional feature for those who want an implementation of an MVC architecture in ASP.NET.

Latest Scott Guthrie post explains in great detail how to implement a simple e-commerce site using the new framework.

MVC maps URLs to classes, instead of files in disk, as most of the other web frameworks do.

You need create your Controller classes (which use a ControllerAction attribute on each method to map the requested URL to the proper controller method and use the parameters requested from the URL).

 Scott uses Linq to SQL ORM for coding the data model. You can use DataSets, N-Hibernate or whatever you like to handle the data access and data objects.

Having such a layer architecture improves not only maintanance but also reusability. You can easily change the controller logic to render different data to the same view page.

This architecture is also very convenient for implementing test cases for each layer/class. For example, you can have a N-Unit class to test each controller.  You don’t need the View/browser to do your unit testing, so it simplifies this task a lot.

Finally you render the UI implementing Views, and having a RenderView method to the proper View from the Controller.

For the view, MVC supports aspx, ascx, master pages and AJAX.NET. MVC View Pages by default derive from the System.Web.Mvc.ViewPage base class. This class includes helpers that you can use in the UI, such as the Html.ActionLink Method that allow you to have links in the page mapping to a Controller method.

So far, using the MVC Framework is pretty straight forward.

I suggest you to read Socott Guthrie first post explaining the new model here with lot of concepts and clear samples.

Brad Adams also posted about using MVC for creating a RSS Feed and Frederk Normen wrote about using Spring.NET to handle dependencies when creating Controllers through a Controller Factory.

If you’d like to learn in detail about all of these MVC concepts, then go to Scott’s post right away !

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

Tags: ASP.NET

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment