views:

3010

answers:

4

I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp.Net MVC.

  • Could anyone tells about pros and cons between those?
  • Which ViewEngine is the better as well for overriding the master template?
+7  A: 

MonoRail and ASP.NET MVC are fundamentally very similar, you should be well off using either one of them. MonoRail has existed much longer and has therefore more higher level features.

The main strength of ASP.NET MVC is it's routeing engine, to be fair MonoRail has pretty much an equivalent routing engine, and with some modification you can use the ASP.NET MVC routing engine with MonoRail as the routing engine is not really in ASP.NET MVC but in System.Web.Routing (Released in .NET 3.5 SP1). ASP.NET MVC and integration with Visual studio is also a plus, and will probably get better as we approach RTM of v1.

The MvcContrib project contains some great view engines, like Spark, NHaml and Brail. No one could be considered "Best", A personal favourite is Spark. For more on spark: http://dev.dejardin.org/documentation/syntax

The WebForms engine has intellisense which is a great advantage that to my knowledge all alternative view engines lack.

Torkel
There is some basic intellisense available for the NVelocity view engine as well (via the CVSI project - http://www.jonorossi.com/projects/cvsi/) - its' fairly rudimentary, but generally that's all you need in your views.
Bittercoder
We're looking at Spark for use here on Stack Overflow - it's looking like a great view engine, so far!
Jarrod Dixon
+14  A: 

Speaking as an advocate of monorail, I've got to say you should probably go for ASP.NET MVC. To be honest, the simple fact that ASP.NET MVC is going to become the default architecture within three years should probably swing it. This equation was different a year ago, simply because the default architecture had serious productivity problems compared to MonoRail.

If you want to talk technical advantages and disadvantages:

  • ASP.NET AJAX is a mess (avoid it), but they've now got jQuery. In fact, the jQuery support is better than any other environment. Of course, you only fully get that with IDE integration with the standard view engine.
  • There are some aesthetic improvements (for instance, the way model information is passed around is much cleaner and more obvious than Monorail).

Also, don't dismiss the standard view engine out of hand. You don't have to throw controls at it like you did with ASP.NET, you can code it in a pretty similar manner to Brail, only using C# instead of Boo.

There are things that are just plain ugly * the number of methods that take object for a parameter. Good luck finding the documentation on what exactly they expect. * Microsoft's fondness for abstract classes over interfaces. They have their reasons, but I still dislike it.

Also, in many ways, MonoRail remains the more complete platform. There's no abstraction for validation or paging in ASP.NET, for instance. Also, there's not really any help for binding to a model. The helpers have very little functionality compared to their Monorail equivalents.

Overall, though, I think ASP.NET MVC is a winner.

Julian Birch
A: 
  1. I think MVC wins hands down. Its feature set is very similar, but is going to be the more "popular" of the two (and thus typically more widely supported, documented and extended throughout the development community). In addition, the new ViewEngine (Razor).. and IDE improvements factor in for me, and boost the value of choosing MVC over monorail, in my opinion.

  2. I've used pretty much all the common ViewEngines, but wound up rolling my own (created an OpenSource Project for it) utilizing the awesome StringTemplate template engine. ST is a true separation of concerns, IMO. I find myself writing better apps as a result, with MUCH less tag soup. I also threw out a quick intro and reference guide if you choose to kick the tires on the engine. I've had awesome luck on projects I've deployed thus far using it. That being said, Razor (MVC 3) looks pretty impressive.

jamisonLikeCode
Jamison, could you expand on #1? I find then end of your answer is deviating from the initial question (no offense, I'm glad to see a string template viewengine for asp.net msmvc)
smoothdeveloper
-1 for lack of justification
Mauricio Scheffer
-1 sounds like an ad.
ssg
Not at all intended to be an ad. Apologies for the format. Was merely expanding upon the StringTemplate engine preference.
jamisonLikeCode
+4  A: 

Apart from perceived popularity and support from Microsoft, ASP.NET MVC still lacks some core features that Monorail has had for a long time like controller organization (Areas), native ViewComponents and Filters that can use IoC to name the most important ones.

I have some big applications that use all of these features and I've had a hard time porting them to ASP.NET MVC.

I have worked with Monorail for some years now and while MVC looks promising and it's flexibility is awesome, I still find it akward that for every other thing I try to do, turns out it isn't there and I have to either plug a little piece of MvcContrib, another piece of SharpArchitecture, build it myself, you get the picture. Monorail is so much easier to work with (right now, that is).

I expect things will get better in the next few of months as some proposed solutions will begin to rise against others and become more mainstream. Hey, diversity of options is good but trust me, you don't want to be in Java-land 3 years ago where there were so many web frameworks that you could build your site using one for every different page!

In the meantime I will keep slowly porting my MR apps to MVC, just in case.