views:

605

answers:

3

I've been using ASP.NET MVC 1 for a while now, and am keen to take advantage of the improvements in MVC 2. Things like validation seem greatly improved, and strongly-typed HTML helper methods look great.

So, for those of you who have real-world practical experience of using ASP.NET MVC 1 and are now using MVC 2, what are your top 5 reasons for using MVC 2?

+3  A: 

EDIT: The question underwent a complete 180 (an instance of the Obama problem) after my answer was written. Upgrading to the 2.0 release of a product seems like a no-brainer to me. The other question was actually more interesting.

I wouldn't unless your app is nearly complete and you don't anticipate new development soon. The number of breaking changes between MVC1 and MVC2 is pretty minimal and you can still use the MVC1 constructs while incorporating new MVC2 constructs in new development. I'm in the process of updating a reasonably large app (50K+ lines of code) from MVC1 to MVC2, and even accounting for the dumb things I did (like not using view-specific models and directly interacting with the ValueProvider) when writing the app as I was learning MVC1, it took me only a few days to make the switch.

So here is my list:

  1. I'm releasing in the next week or so.
  2. The app is complete and I'm not doing any more development.
tvanfosson
It seems that you have answered the question "top reasons NOT to use MVC2" that is quite opposite to what is asked
iPhone beginner
@iPhone - except that he edited the question and completely changed it. Look at the edit history; complete reversal.
tvanfosson
@tvanfosson: No offence intended - I've commented my quesiton accordingly.
Richard Ev
@Richard - It is annoying to have a question change signficantly enough to make you look like an idiot. Next time you might want to leave a comment for anyone whose answer no longer makes sense after an edit to give them a chance to update it and let people know that it's not the answer's fault (necessarily).
tvanfosson
@tvanfosson I think the risk of you looking like an idiot here is quite theoretical. :)
bzlm
+1  A: 
  1. Areas
  2. New HTML helpers
  3. Much better Model support (Html.TextBoxFor<T>())
  4. 2 > 1
  5. Easy conversion
GalacticCowboy
I guess numbers 2 and 3 are pretty much the same thing...
GalacticCowboy
+3  A: 
  1. TemplatedHelpers EditorFor, DisplayFor
  2. ViewPage changes with ModelMetadata and ViewData.TemplateInfo as properties accessibile in the View.
  3. MVC Areas + MVCContrib Portable Areas
  4. ModelBinding changes result in more secure MVC apps for free.
  5. DataAnnotationsModelBinder is a huge timesaver for validating CRUD forms.
jfar