Asp.Net MVC vs Castle MonoRail
Asked Answered
P

4

27

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?
Pantin answered 14/11, 2008 at 13:34 Comment(1)
There is no "best", this is a subjective and argumentative question, I suggest you rephrase is to "pros and cons of x vs y" and chose the which is best yourself.Hoodlum
U
27

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.

Uproar answered 3/2, 2009 at 16:30 Comment(3)
Looking at this three years later, it's amazing how little has changed. Monorail has lost most of its developers, but ASP.NET MVC still hasn't actually achieved feature parity. Razor's an improvement, but view engine syntax isn't really that big a deal.Uproar
What do you think of MVC 5 and ASP.NET in general now that Visual Studio 2013 has RTM'd?Pharos
I've never answered this because I don't really work on that side of thing these days. However, my general impression is that Microsoft are continuing to jump the shark with features you don't need. However, since MVC is built from simple things at the bottom (unlike WebForms) you can always just ignore the cruft. This sounds negative, but the truth is it's much better than it was when I wrote this answer. Async, WebSockets, and Gulp support are all things I would have killed for back in the day.Uproar
D
10

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.

Display answered 14/11, 2008 at 15:21 Comment(2)
There is some basic intellisense available for the NVelocity view engine as well (via the CVSI project - jonorossi.com/projects/cvsi) - its' fairly rudimentary, but generally that's all you need in your views.Interlude
We're looking at Spark for use here on Stack Overflow - it's looking like a great view engine, so far!Disharoon
H
7

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.

Hagiolatry answered 13/5, 2009 at 16:2 Comment(0)
S
1
  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.

Siloxane answered 13/2, 2009 at 21:18 Comment(2)
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)Antihero
Not at all intended to be an ad. Apologies for the format. Was merely expanding upon the StringTemplate engine preference.Siloxane

© 2022 - 2024 — McMap. All rights reserved.