Wednesday, October 25, 2006 11:59 AM
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
- 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
- Need to leverage MRs ViewComponents more
- Need to work on reuse in my views
- Would PageMethods for MR would be cool. Would seperate the views form the Controller for me. hmmm...
- Figure out how to best structure my views with AJAX/Components in mind.
Views\
Ajax\
Customer\
OldSchool\
Customer\
Components\
??? - 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...
http://haacked.com/archive/2006/08/09/ASP.NETSuper...