views:

598

answers:

3

I am designing an green field application, development will start on it tomorrow as all the User Stories, etc. have been finalized. I plan on using Windows Azure, with ASP.NET MVC, I noticed that MVC 2 RC2 is about to be released but there is a lot less literature on MVC 2 compared to MVC 1. Are there substantial differences between the two versions? I am thinking it would be prudent for me to just start using MVC 2 now, rather than later...

What do you guys think?

+1  A: 

The differences between MVC1 and MVC2 are fairly minor and include features like website Areas and Client-Side JQuery validation against your object model. I strongly suggest starting with MVC2, rather than trying to use its predecessor.

Nathan Taylor
+3  A: 

If you are confident that your go-live date will be well past the planned release date for MVC2, then I'd go with MVC2.

Richard Ev
Are there any implications in using MVC2 in a production environment prior to its Go-Live date? Is it not permissible?
Nathan Taylor
The risk you'd be taking is that there could be a defect (already discovered, or not yet discovered) that could impact your project. Of course the same can be said for software that is officially "released" too, but at least then you have a reasonable defence...
Richard Ev
+7  A: 

Go with MVC2. Scheduled release time is likely to be next month considering it's in RC now. Despite one of the other posters saying there are minor changes, there are actually significant changes:

  • Strongly typed extension helpers
  • Strongly typed views
  • View model data annotation validation
  • Many performance improvements w/r to caching the "reflecting" parts of the code (expression trees can get expensive)

One of the best features provided you're developing for .NET 4 is the <%: syntax for automatic HTML encodes for strings in your views.

So instead of using:

<%= Html.Encode("<script>alert('you've been hacked');</script>") %>

You can do this:

<%: "<script>alert('you've been hacked');</script>" %>

Think of it like turning the equal sign sideways, like closing the gate.

Craig Huber
It should be haacked!
alexn
Agreed... Phil's a brilliant guy :)
Craig Huber