At HyperTrends, we have started moving a lot of our development to using the Microsoft ASP.NET MVC Framework. This is a significant jump from ASP.NET but I strongly believe it is for the best. Two of our critical projects have now been implemented using MVC and I can definitely assure you that we’re already seeing the benefits of using MVC.
So why use MVC? Here are some of the reasons why I think you should use it:
Testability
ASP.NET MVC is built around the notion of testability. When you create a solution, you can actually create a test project and write your own tests using Visual Studio or NUnit. You can test your routes, your controllers, your views, your services, your repositories and everything that you can think of. This is a very, very good way to develop software. You are greatly reducing the risk in Software Development by adding testability right from the development phase.
Patterns & Practices
MVC offers you a whole set of patterns and practices to follow. It however, doesn’t preach any certain technology. You are free to implement your own as long as you follow the simple patterns of development. You can replace the View Engine, the default Controller factories, the way you use AJAX (either Microsoft AJAX or jQuery), the repository access mechanism (use OR/M like NHibernate, EF or Linq to Sql), dependency injection etc. This gives you complete control over everything. MVC is highly flexible and highly customizable out of the box and can be really extended any way you want.
Works with HTTP instead of against it
One of the biggest difference between MVC and ASP.NET classic is that ASP.NET classic went against the HTTP Protocol by adding the notion of state (using View State). MVC however uses the Http protocol to its advantage. You program against Http Get, Post, Delete etc and that makes things very intuitive and straightforward.
Absolute control over HTML
ASP.NET classic had a major drawback. The HTML emitted couldn’t be designed the way you wanted. Elements had funky names, the server side controls generated tables and if CSS was used, it wasn’t flexible enough to seamlessly transition a designer’s HTML into a Developer’s HTML.
This caused a lot of overhead for developers. We at HyperTrends still deal with issues in our classic ASP.NET web apps where we take in a designer’s CSS HTML and then spend endless hours converting it into a format that ASP.NET likes.
The end result is that a designer needs to fully understand ASP.NET Server controls in order to make this transition seamless. This means that one cannot outsource design + css tasks to designers who don’t understand ASP.NET Server controls. If we do, we have to write long specs with it to ensure that CSS is written in a way that makes it most compatible with ASP.NET HTML code.
Good news! MVC doesn’t impose any restrictions on your HTML format. In fact, the methodology allows you to write pure HTML code (if you want), or use the default HTML View engine, or even integrate with a 3rd party View engine. The control is in your hands.
Ajax, Ajax and Ajax
Every time I look at an app by 37Signals, I am totally blown away by some of the AJAX functionality. However, the good news is that I can do all of that in my MVC app now thanks to both the Microsoft AJAX library and the native jQuery integration within the MVC framework.
We have personally integrated a lot of 3rd party jQuery controls and AJAX behaviors in our applications. The end result is amazing.
I think that should give you good enough reasons to use the MVC framework. Here are some final miscellaneous reasons:
1. Programmers don’t write spaghetti code because the methodology doesn’t let you write it. Gone are the endless lines of code. They are replaced by simple controller actions calling services, which in turn call your DAL/Repository layer.
2. Layered programming using dependency injection ensures that code is manageable and easy to debug. Technical debt reduces significantly.
3. Everyone follows the same pattern of development – This is a significant improvement. In ASP.NET, your developers were free to write their method implementation the way they wanted. No two people had the same approach towards coding.
This caused headaches during technical code reviews and imparted no fixed structure towards coding. With the advent of MVC, this is totally eliminated. Everyone follows the same pattern of development thereby improving the overall software design process.
In Closing…
I hope you consider ASP.NET MVC framework as a strong candidate for all your future Web Development needs. Feel free to chime in on the comments if you need any help/guidance on the same. We have some interesting code snippets and sample projects to give out in the next few weeks. Stay tuned!
Till then, ROCK ON DEVELOPERS! ROCK ON!




Your Name