MonoRail vs ASP.Net

Lately I have been having a crisis of faith about MonoRail and have been looking at ASP.Net again. All of the neat controls, and IDE support are sooooo tempting. So late last night I happened to catch Ayende online and here is what he had to say:

ASP.Net

  • Pro
  • Because it is what everyone use.
  • Has controls
  • Isolate from web
  • Con
  • Isolate from web
  • You work in a different model than what really is - leaky abstraction
  • view state
  • Very complex model for doing really simple stuff.
  • Encourage mixing of UI / BAL logic. No, code behind is not  considered a seperation

MonoRail

  • Pro
  • solid MVC architecture.
  • Work in the same model as actually happens
  • Feel the magic - almost like you are creating an API, instead of pages.
  • Strict seperations of UI logic / BAL
  • complex UI logic is usually very easy.
  • Close to the "metal"
  • Cons:
  • Not Microsoft - some people sees that as a con, not me[nose smile]
  • Not something that everyone knows.
  • Tool support not that great
  • No designer - a plus for me.

MY BIGGEST THING

I feel like I am doing ASP.Net development in MR. By that I mean I have a bunch of controllers with 3-4 actions and each action has 1-2 views. I don't feel like I am building an API I feel like I am building crap. I think I need to work with ASP.Net for awhile to remeber why MR is better.

SOMETHINGS I NEED TO DO TO IMPROVE MY MR CODEBASE

  1. Need to leverage MRs ViewComponents more
  2. Need to work on reuse in my views
  3. Would for MR would be cool. Would seperate the views form the Controller for me. hmmm...
  4. Figure out how to best structure my views with AJAX/Components in mind.   Views\     Ajax\       Customer\     OldSchool\       Customer\     Components\    ???
  5. Figure out how to handle all of these AJAX methods that are starting to appear that look like arse (ajax_city_econ?) and use the AJAX attributes.

public void ajax_city_econ(string id) { //do stuff }

//to

[AjaxMethod] public void CityEconomics(string id, bool ajax) { //do stuff }

RANDOM MR REQUEST:

I wish controllers didn't have to inherit from Castle.MonoRail.Framework.Controller and instead could just request a ExecutionControl (An Interface of course)  object in their constructor so that I could more easily test my controllers. Then those that want the base controller experience could still have it (with property injection) and it would be wrapped by Castle.MonoRail.Framework.Controller as a base class.

I am jealous of these POCO controllers in ASP.Net http://devlicio.us/blogs/jim_bolla/archive/2006/10...

This article is part of the GWB Archives. Original Author: Dru Sellers

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.