First Look at MonoRail
I “discovered” MonoRail over the past couple days, mostly from a link on Scott Hanselman’s podcast. I had heard about it and finally decided to take a look.
MonoRail is to asp.net development what Rails is to Ruby web development. MonoRail allows you to use a pure MVC pattern in your asp.net application. Controllers handle the page flow and interactions, Views are just that – a “dumb” UI, and Models are your business objects. MonoRail has some nice integration points with Castle’s ActiveRecord library for .net, which makes a lot of the forms work like they would in RoR.
The thing that I think I like the best about MonoRail is that it allow you to develop as if you were using Ruby, but its got the scalability of typical asp.net web apps. I read much more about scalability concerns with RoR as opposed to asp.net, and while I think the scalability of either environment only comes into play when you have a hugely popular site, I still like developing in .net better than RoR.
One feature, albeit small feature, that I really like about Rails that I haven’t seen yet in MonoRail is respecting the intent of a GET request. In Rails when a “Destroy” link is shown, it links to some url like this:
http://localhost:3000/products/destroy/3
Which would be routed to the “destroy” action for product with ID = 3. This works of course, but its better to use a POST request when modifying data, not a GET request. So, the link in Rails actually doesn’t go to that url, instead it uses javascript to write out a “