MonoRail vs ASP.Net

Dru Sellers is posting about some doubts he recently had about using MonoRail. He posted a part of a conversion that we had about it yesterday, and then Ben Scheirman responsed with:

I write my pages to be as thin as absolutely possible, so while good design is not encouraged, it's definitely possible.

IM is not really the medium to express complex thoughts, and I thought that it may be helpful to expand a bit on the subject.

I am currently working on a very big project that uses ASP.Net Web Forms model, and there isn't a lot of fancy UI stuff in there, and I still suffer from the model that ASP.Net tries to make me work in.

  • ViewState is a problem that we lost days on. Mostly because we are doing a lot of dynamic control generations, and we sometimes got the viewstate from the previous page into the new page, causing much havoc. But also because it just plainly so different than the way that the web works.
  • It highly encourage the PostBack model.
  • Simple things are not simple. Take for example needing to do something like disabling links on certain rows in a grid because of their state (capture the RowDataBound, get the cell by its numeric index, find the right control, disable it).
  • Complex things are complex. Page life cycle issues, nested child controls initialization order, events firing order, view state corruption issues when building multi-view controls, etc.
  • It is not fun to work with.

It got to the point where for my demo, where I need to present a simple hierarchy of messages, I tried at first to do this in ASP.Net, but stopped when I realized how complex this is going to be, and wrote a little demo that did it all in WinForms. Using WinForms, it took me half an hour to get to 70% of what I wanted, using ASP.Net WebForms, it would take me a day.

Frankly, at this point, I am not going to do any ASP.Net WebForms work unless I am paid for it, and I am going to push hard to make sure that any incoming web projects will use MonoRail.

When asked, I listed the following as things that make MonoRail hard to embrace:

Not Microsoft - some people sees that as a con, not me

Potshot: At least this way I know that it will not have a hard dependency on the office 2007 beta 3 refresh 1. And it will continue working if I install IE7 on the server machine.

Not something that everyone knows.

But, it is very easy to learn how to start, and it doesn't punish novices by letting build something in completely the wrong way. The learning curve is very smooth, as well. And frankly, if you can't learn MonoRail without a 400 hours course that will chew the material for you, I don't want your on my team.

Tool support not that great

If only I could get Brail syntax highlighting in Visual Studio... I don't even need intellisense, I am not doing anything complex in the views. For that matter, I usually edits my views in SharpDevelop anyway, so this isn't that big of a deal.

No 3rd party controls

There aren't any 3rd party controls for MonoRail that I know of. But, it can (easily and painlessly) use all the HTML controls that are out there. No I'm not talking about <input> ;-). I'm talking about everything that the non-ASP.Net world uses, which is more than powerful enough to create beautiful sites.

No designer - a plus for me.

I am not using the designer at all, mostly because it is horrendously slow and like to put stuff like style="height=29px" which are a killer to remove afterward.

Print | posted on Thursday, October 26, 2006 7:29 AM

Feedback


Gravatar

#  10/26/2006 7:58 AM Ken Egozi

My point of argue in favor of MR for people who are afraid of &quot;non-microsoft&quot; is, that actually MR is ASP.NET. It is just not WebForms.
You get all the good stuff from ASP.NET: the .NET framework for start, compiled views (on Brail - kudos to you), the HttpModule stuff, seeamless integration with AR.
This is what I say to the PMs, etc.

To the developers themselves who are afraid, There's a more detailed approach.
Developers (especially ones who didn't do web programming aside ASP.NET, and probably has a lot of VB experience but no PHP/JSP/ASP) like WebForms cuz they can get to the txtUsername.Text, txtPassword.Text, and txtAge.Text easily, not needing Request.Form[&quot;Password&quot;] (hey - it's not typed !!!) . But then I reffer them to the fact that actually txtAge.Text isn't typed too. it's a string, and should be parsed, tried, validated etc.
They should also manually create a User instance, and fill it's properties.

Doing the same on MR with Dispatching and AR is there without any line of code. I show them an example aqnd then hold them as they almost fall off their chairs.

Not'n like a good example.

Maybe having a ViewEngine that's use c# or V.NET instead of boo (not the WebForm ViewEngine which suck, but somthing similar to Brail) can make the move from WebForms to easier for developers, but frankly, as you've said, people who can't get it OJT with a few examples aren't the one's I'm likely to work with anyway.


Gravatar

#  10/26/2006 5:57 PM Ben Scheirman

&quot;ViewState is a problem that we lost days on. Mostly because we are doing a lot of dynamic control generations, and we sometimes got the viewstate from the previous page into the new page, causing much havoc. But also because it just plainly so different than the way that the web works. &quot; --Sometimes this can be a blessing. When choosing persistence strategies for page state, you have a lot of options. That's a good thing! The problem I see is that a lot of developers don't understand it fully and abuse viewstate. It's the same problem with people abusing session, only this time it adds weight to the page (in both directions!)

&quot;It highly encourage the PostBack model. &quot; -- I don't see this as a problem. As long as you're aware of areas where you'll benefit from user friendly urls and back-button-friendly navigation I think you can avoid areas where it sucks. Again, I find that developers frequently rely on postback for everything, which I don't agree with.

&quot;Simple things are not simple. Take for example needing to do something like disabling links on certain rows in a grid because of their state (capture the RowDataBound, get the cell by its numeric index, find the right control, disable it).
Complex things are complex. Page life cycle issues, nested child controls initialization order, events firing order, view state corruption issues when building multi-view controls, etc.
It is not fun to work with.&quot; -- I fully agree with you here. Maybe I take for granted that I've been working with ASP.NET for a long time, but these things are like second nature to me now, so I don't think about it.

&quot;Using WinForms, it took me half an hour to get to 70% of what I wanted, using ASP.Net WebForms, it would take me a day.&quot; -- I'm on exactly the opposite. I enjoy living in the boundaries of the web, mainly because I understand it in and out, and the boundaries of server-side / client-side / page views can sometimes encourage better views. I've written quite a few winforms apps and I never get this level of confidence. I'd love to work on a project with a winforms guru so that I can be as confident in winforms as I am with ASP.NET.

I am really just defending ASP.NET because I enjoy it immensely. It is a breath of fresh air from my days with ColdFusion, PHP, and ASP. Now I guess it's time for me to try MR so that I can understand what you guys are talking about :)


Gravatar

# Xanax norx needed one day fedex overnight delivery. 3/12/2007 4:52 PM Xanax norx needed one day fedex overnight delivery.

Xanax norx needed one day fedex overnight delivery.


Gravatar

# Marc-Andr?? Cournoyer&amp;#8217;s blog 3/16/2007 2:18 AM Pingback/TrackBack

Marc-Andr?? Cournoyer&amp;#8217;s blog

Comments have been closed on this topic.