Alternatives to ASP.NET: Rails-style Development

by bob on March 17, 2007

Microsoft Visual Studio and out-of-the-box ASP.NET has long taken a Rapid Application Development (RAD) approach to web site construction which is quite different from the Model-View-Controller (MVC) approach most famously used in the popular Ruby On Rails platform.

Rails-style development seeks to achieve “separation of concerns”. Objects called controllers handle application flow; a persistable object model is provided for the data; and viewers are purely concerned with presentation. In the long run this can result in cleaner designs and more maintainable applications. ASP.NET embeds a great deal of messy code within each “web form” and does little to encourage separation of data tiers, much less “concerns”.

I have little trouble buying into this and would love to escape the inelegance of stock ASP.NET development using something like Castle MonoRail, which provides C# templates and libraries for rails-style development under either the Microsoft or Mono runtimes. And soon, a couple of Ruby implementations will work with Visual Studio and will probably allow Ruby On Rails development with a pretty good degree of interoperability with standard .NET assemblies and components.

The question is, do these alternate platforms have legs? My guess is, in the .NET world, they will only be the province of True Believers for the present. Here’s why.

If you’re anything like me, you have little alternative than to be deeply committed to the components, tools and APIs that Microsoft provides. That’s because customers and employers feel safe with the “approved” way of doing things. We’re expected to dive into the middle of existing code bases and that requires that we invest significant time and effort in our continuing education so that we understand those existing code bases.

In addition, most companies have investments in third party libraries and components which themselves are deeply entangled with and exclusively tested on Microsoft-standard code base configurations. On top of this you frequently encounter popular frameworks such as DotNetNuke in the field, which aside from being written with standard ASP.NET environments in mind, have extensive peculiarities of their own — not to mention their own development ecosystems. None of this can be readily leveraged in an alternate reality such as a rails-style MVC code base.

How many developers have the energy and lack of a personal life to pursue something like MonoRail in any depth using their “spare time”? For most, this has “fun to play with but gets no paying real-world use” written all over it.

MonoRail not only requires that you go through a complete change of approach and a significant learning curve with little or no support from your paying work; it anticipates that you’ll also buy into related technologies such as NHibernate that you may not be familiar with or sold on, either.

Hopefully you’ve progressed beyond straight ADO.NET data access code embedded in forms and have some kind of n-tier strategy worked out. You may use custom entity objects in the business layer rather than DataReaders or DataSets. But if the vast majority of .NET code bases I’ve been exposed to are any indication, you haven’t cast your lot wholeheartedly with some full blown object-relational mapping (ORM) implementation.

The issues are similar: it’s difficult to acheive reuse of ORM code unless you lock-in to one implementation (NHibernate for example) with all its particular performance and maintainability trade-offs. And it’s hard to lock-in unless you work for an organization that has buy-in to that particular solution. It’s even harder if you’re an independent contractor like myself, because the odds of most of your clients magically standardizing on a particular ORM library / platform is next to nil.

As an independent contractor I do have one advantage: some of my clients don’t know or care what specific technology I use, and I can decide to do a small project using MonoRail, NHibernate, or even Eiffel.NET and so long as it works they won’t care. I am currently hunting for such an opportunity. I’m also thinking of exploring Umbraco as an alternative to DotNetNuke on an upcoming site rewrite. If nothing else these will be broadening experiences … but I just don’t see the vast majority of day to day .NET applications being done any way but the Microsoft Way, love it or not!

{ 7 comments… read them below or add one }

hammett March 17, 2007 at 12:43 pm

MonoRail has no dependency on NHibernate, ActiveRecord or any data access approach whatsoever.

Bob responds: Nor did I claim that it does. However every platform / methodology has a “typical” adoption path and judging from the MonoRail tutorial, the use of such ORMs are encouraged. As such, community support will tend lean in that direction. Hopefully I’ll find out for myself soon!

Guy Peled March 18, 2007 at 12:17 am

Hi,

I wanted to introduce you to Visual WebGui which is an open source extension for ASP.NET aimed at developing complex AJAX applications like outlook web access in a very intuitive way and rapid way.

Visual WebGui extends ASP.NET by providing an alternative pipeline that provides full WinForms like programming including design time capabilities. With this solution you have the power of rapid developing application as you do in WinForms with out loosing the ability to still use web concepts were needed.

To see the framework in action check these quick start videos here:
http://www.visualwebgui.com/Default.aspx?tabid=297

The project home page is here:
http://www.visualwebgui.com

Guy Peled
Founder & Chief Architect
Gizmox – Visual WebGui

Bob responds: Looks like a great product and I will definitely investigate further. However, on the surface at least it looks like you’re going further down the path Microsoft has already taken: abstracting away the mechanics of building a web app with layers of complex plumbing. The whole point of this particular post was to question that wisdom and consider whether we aren’t better off in the long run with a pattern like MVC that embraces the nature of web apps rather than fighting them. For me the jury is still out; likely in the end I will end up finding something like your product as a more politically acceptable alternative for many of the environments I work in, which will hopefully make ASP.NET development more enjoyable and maintainable; but I’m determined to have a rails-style experience or two, in order to make an intelligent comparison.

Ken Egozi March 18, 2007 at 5:30 am

As I say again and again, the learning curve for MonoRail depends on the starting point. A new web developer will learn MonoRail a lot faster than WebForms (I do not mean drag-n-drop demos – but real WebForms stuff).
If the guy has experience with PHP/ASP/PERL/Python/J2EE (and that’s making him a real WEB developer), the difference will be even more noticeable. Since MonoRail is more like the traditional web dev approaches than the WebForms approach.
They do not have to learn new languages (like boo) eiether. There is a ViewEngine based on c# as a ‘scripting’ language for the views, and there’s NVelovity which JAVA guys can relate to. AND some talks in the net about msft taking the path to rails-y implementation in future ASPNET releases.

Bob responds: Very good points! It is an interesting question for another post as to what a “real developer” is and how much of a “real developer” one has to be to produce quality web apps. However, for purposes of this post I’ll just say that for better or worse, ASP.NET is a widely accepted and comfortable abstraction and I don’t see enough thoughtful reflection going on, especially in the corporate world, to motivate large numbers of ASP.NET developers to step outside that comfort zone. For every person who does not chalk up their daily frustrations with ASP.NET to “just the way things are”, there are probably at least ten people who do … and will stick with the status quo.

jc March 20, 2007 at 12:24 pm

Very cool blog Bob. Theres lots of exciting news lately of ASP.NET moving towards Ruby/Rails. With ScottGu’s latest talk about exploring MVC, and the new language enhancements of c# 3.0 (blocks, extension methods, linq) I think we’ll see a serious .net rails competitor in the next couple years.

Personally I cant wait that long and have gone all rails for new development. But it wont take much to get me back on .NET as I have tons of respect for the platform and its future.

Liming Xu March 20, 2007 at 7:43 pm

Totally agree with you there Bob. For me personally, ASP.NET has been great except the MVC part. I checked out MonoRail because I wanted to use it in our software, the only thing that stopped us from looking further is we still haven’t found out how to properly bind to the GUI components say a gridview.

Another thing is monorail community is still small where ASP.NET forum is very very active, when we need help, we know we could get some.

We didn’t want to waste too much time, so doing the standard “asp.net” way will be most flexible. Although not totally MVC, it’s at least decent compare to JSF and Php or whatever.

Huw Collingbourne March 29, 2007 at 2:45 am

Thanks for the mention. I should point out, though, that the Ruby In Steel IDE for Visual Studio isn’t coming ‘soon’. It’s here already! The personal edition is free. The Developer Edition is our commercial system. More from the web site at: http://www.sapphiresteel.com

best wishes
Huw

Seree August 4, 2007 at 7:35 am

Hi Bob,

Thanks for the topic, I gonna try it! as now I thinks Ruby/Rails style is coming.

Leave a Comment

Previous post:

Next post: