Question

I'm coming from Ruby on Rails, and I need to create a C# web application. Currently I'm looking at ASP.NET MVC and MonoRail. Most of the comparisons I find are from 2008-2009, when ASP.NET MVC was still new, and most of the points against MVC was that it's too raw, not nearly as refined as MonoRail.

Well, several years have past since then, and Microsoft did alot of work on ASP.NET MVC. How do the modern versions of the two frameworks compare to each other?

Était-ce utile?

La solution

I evaluated MonoRail about four years ago and, compared to today's mvc3, these are the main differences (imho)

  • Razor templating engine as MVC default. It's a pleasure to use, while Monorail defaulted to NVelocity. I checked out Castleproject's website and there's a plan to upgrade Monorail...
  • Vastly more documentation for MVC3, and as per today -- maybe it's my fault -- I can't find any online documentation on Monorail's site.
  • Areas, Partials, Razor extremely integrated in VS2010. And if you don't like it, you can plug in and use different templating engines.
  • MVC3 has better Ajax/Jquery integration, unobtrusive form validation

Autres conseils

I have been working with both frameworks for the last few years. Initial we stuck with monorail when mvc came out since we felt that it was raw. IMHO MVC3 is now at a point where it's more mature than Monorail 2 with better support, more documentation and newer versions coming out regularly.

  • Razor is more powerful than nvelocity and has great Visual Studio support which nvelocity lacks.
  • Monorail views are not compiled vs MVC3 view which are compiled. Sometimes when developing its nice to just change a view and see then change immediately. On the other hand compiled views are faster.
  • Monorail has not had a new version for some time and seems stagnant. Monorail3 is in the works though.
  • MVC3 supports helpers as well now, both as extension methods but you can also declare them directly in your Razor views. Monorail supports helpers only as static methods of a helper class.
  • MVC3 has much better routing support.
  • MVC3 now has IoC support for filters as well.
  • MVC3 supports applying filters to the method level but monorail supports filters only on the controller level.
  • MVC3 does not support an Ioc out of the box but instead you can use the IDependencyResolver for this. You can find many solutions around for this.
  • MVC3 has great support for CSRF attacks. In Monorail you will need to develop this on your own by using a combination of helpers and filters.
  • MVC3 supports pre-compiling views so you can minimize errors before publishing your site. but you cannot do this with nvelocity view in Monorail since they are interpreted
  • MVC3 html encodes any string automatically. In Monorail you always need to call a helper for this.

When Monorail 3 comes out though it will be interesting to see what they support. Look at https://docs.google.com/document/d/1AkeeJPh8kZQKtnHN3RDR3v-UfG7zt9wCL0jMiualUqI/edit?hl=en&authkey=CN7U99YN&pli=1 which is a value proposition for Monorail 3 by Hammet.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top