May 27 |
MVC and Your Resume |
Microsoft’s ASP.Net MVC Framework was released in March 2009. Like most software developers, I always want to get my hands on the latest and greatest. The MVC architectural pattern has been around forever (Wikipedia says 1979), but Microsoft’s implementation for ASP.Net is new. So, I’ve been itching to get a project to use ASP.Net MVC with.
Me 10 years ago, would want to dive in and rewrite the last few projects I’d worked on, and insist my next project use ASP.Net MVC. 10 years and several projects later, I’ve learned that you can’t ”Put your Resume Ahead of the Requirements“. The architecture has to fit the project’s requirements, not the other way around.
So before I put MVC on my resume, what is the right situation to use it?
Let’s start with a very brief explanation of what ASP.Net MVC is. For more information check out www.asp.net/mvc.
There are 3 functional areas of an MVC application - Model, View, and Controller. The Model contains the domain objects, rules, and properties. The Controller classes perform the mapping between the web request and the corresponding Model operation. Finally, the View is the HTML representation of how the web response data should be displayed.
Because the Controller class is performing URL routing, we can have friendly URLs that reflect the intent of the request. The URL to Edit Employee 1 could be… http://localhost/Employees/Edit/1. This site’s URLs are formatted as {controller}/{action}/{id}, but this is configurable. Additionally, if the routing format included an employee name or product name, URLs could be optimized for SEO purposes… http://localhost/Companies/Details/1/Aptera-Software.
Back to the topic - what is the right situation to use MVC?
It sounds simple, but if the advantages out-weigh the disadvantages, then it is the right situation. For the sake of this discussion I am limiting the choices to using either ASP.Net MVC or ASP.Net Web Forms (traditional ASP.Net).
The advantages of ASP.Net MVC include Unit Testing, Separation of Concerns, and complete control and extensibility of the framework.
- Unit Testing - A greatly enhanced ability to isolate individual units to test. Unit tests can create mock implementations of required references, such as HTTPContext. This allows for predicable and repeatable testing inputs.
- Separation of Concerns - While this can be implemented in a properly designed Web Forms application, it is the natural design of an MVC application.
- Extensibility - Where an ASP.Net Web Forms application provides a lot of functionality for you, it’s not always what you want. The MVC framework allows you customize every step of the HTTP process - extending or replacing components as you see fit. It’s very powerful, but requires work to develop.
The advantages of ASP.Net Web Forms include rapid development for smaller applications, a large collection of server controls, and existing developer expertise.
- Rapid Development - ASP.Net Web Forms handles almost all of the HTTP implementation details between a page request and response. Page and control events are provided and extended from the System.Web.Page assembly.
- Server Controls - Visual Studio ships with a large collection of server controls for ASP.Net Web Forms, and there are many other 3rd party control developers providing specialized controls.
- Developer Expertise - The ASP.Net Web Forms framework has been developed against for almost 8 years, and has a large group of experienced developers. It will take some time for developers to ramp up on MVC, if they are not already familiar with the framework concepts.
I would suggest that if a project is large enough to benefit from a more extensible framework, or if unit testing is critical, then that project would be a good candidate for MVC. If the project deadline is too aggressive to allow ramping up on the new framework, you may have to fall back on Web Forms. Until I get that right project, I’m reserving a spot on my resume, but I’m not rushing it. I think Me 10 years ago would begrudgingly understand.
Also note that the decision does not have to be limited to either MVC or Web Forms. In the right project, they can be used side-by-side, taking advantage of the strengths of both.










