There, I've said it. If Castle Project has been on your "need to check that out list," you very much need to make it a higher priority. Recently, I discussed how our development team has been migrating a 1 1/2 year old project into the MonoRail framework. We had been using Windsor for some time but needed a simpler approach to managing the separation of presentation and logic. MVP was our previous approach which we were implementing in a disciplined manner, exactly as I described in a previous article; but after a year or so of using it, we began finding MVP becoming cumbersome, not worth the effort on simpler pages, and tricky to determine exactly where the line is to be drawn between the code-behind and the presenter. (This becomes particularly difficult when taking a Supervising Controller approach as opposed to a Passive View approach as the view may still have access to the domain. But I still prefer it over Passive View as it decreases the amount of primitives and DTOs being passed between the view and the presenter.) The only real drawback to integrating Castle Project tools with legacy code is that it is difficult to appreciate all that the Castle Project has to offer.
Over the past couple of weeks, I've been fortunate enough to do a small ecommerce website from the ground up with everything Castle Project has to offer. What I've found particularly pleasing is that it just works. I needed to add ajax support to a "contact us" page to replace the input form with a thank you message; with just a couple of lines of code, AjaxHelper made it trivially simple. (IMO, only telerik rivals Castle's simplicity with respect to AJAX.) I needed to get my code talking to a database; ActiveRecord required about 10 minutes to set up my entire data communications layer...no DAOs to manage, no NHibernate HBMs to create, and certainly no SQL to write. (I doubt that I would use ActiveRecord on a large project in favor of a cleaner separation of domain and data, but for smaller projects, it's perfect.)
A major concern I had about moving to MonoRail was the limited support for sophisticated, off-the-shelf, ASP.NET user controls such as what telerik has to offer. I've come to find that:
You generally don't need the complicated sophistication that third party tools tout.
Most of the time, these features are gold-plating that clients never use which are only offered to make the lives of developers more interesting. (I put myself squarely in that camp.) Take grids for example. Off-the-shelf, third party grids typically provide features such as drag-and-drop dynamic grouping, drag-and-drop column ordering, column resizing, and keyboard navigation. These features are a lot of fun, but they're almost always gold-plating. In the 10 years I've been developing, I've never had a client request one of these features...it's not because they're (all) ignorant, it's because they just don't need it. When you consider that 2/3 of projects significantly overrun their cost estimates and that 64% of features included in products are rarely if ever used [Agile Estimating and Planning
by Mike Cohn], do we really need to be pushing all these gold-plated bells and whistles? Furthermore, I can't tell you how many hours I've wasted trying to customize one of these features to "do what I want it to do" when it never really needed to be there in the first place.
Alternatives exist to give you the same time savings that off-the-shelf .NET controls provide.
In addition to helpers provided within
MonoRail, many other options are available for developing sophisticated web applications. The Yahoo! User Interface Library
provides animation utilities, drag and drop capabilities, pop-up calendars, rich text editors, menus, trees, and a rapidly improving data grid. Script.acul.us
provides a potpourri of visual effects rivaling what can be done in WPF. Here's a few more to help extend your coding reach: prototype
, dojo offline
, and Google Gears
MonoRail view components are much simpler than ASP.NET user controls.
As I'm starting to sound like a used car salesman, I believe I should stop while I'm ahead (or at least at an even keel). The bottom line is that Castle Project really does provide an all in one package for improving the web development experience...definitely cooler than Jerry Springer.
09-21-2007 9:58 AM