Archive for MonoRail tag
Castle Project & MonoRail concerns
I really want to like MonoRail but I find it difficult to feel the love no matter how much I desire Rails-like features without the scalability issues and unusual syntax/learning curve of Ruby.
Here’s my list of concerns:
Slow release cycle
The current release is 1.0 RC2 which was released November 1, 2006. That’s some 10 months ago and yet we have no RC3 or final release.
Part of the hold-up seems to be trying work out what to include and exclude, which brings me onto my next point…
Abandoning convention over configuration?
One guiding principle behind Ruby on Rails is Convention over Configuration. This means that instead of allowing you to configure everything to the nth degree a single ‘conventional’ approach is taken..
This results in an gentler learning curve with less to configure and is generally part of KISS.
The Castle Project’s take on this philosophy is a little off by providing you with a combination of view engines and IoC interfaces to chose from.
In the case of view engines neither NVelocity or Brail support C# or VB.NET which does mean you need to learn another language for writing your views and loose syntax highlighting and IntelliSense in the process.
If I was prepared to accept all that I might as well switch to Ruby on Rails.
The WebForm view engine supports C# but has a number of limitations and uses what I was trying to get away from in the first place (WebForms).
Ken Egozi has come up with a C# based view engine that avoids WebForms confusingly named AspView.
With Inversion of Control whether you use the MicroKernel directly or the Windsor Container wrapper is up to you and I hope you figure out which to use better than I did.
Castle Project web site
Looks good however needs better maintenance/management:
- Wiki contains spam (FAQ, Tutorial, Tips and Tricks etc.)
- Samples download returns a 404 not found
- Enabling Inversion of Control is an empty stub yet is linked from the main intro page
I couldn’t find anything about how navigation/site maps are managed.
Going forward
Castle Project say their projects are independent and they should consider breaking them into separate downloads with individual release cycles to keep the pieces moving independently and competitively.
MVC alternatives
Microsoft are working on an MVC engine for ASP.NET themselves. Whilst Microsoft’s track record with user interface tool kits is less than spectacular the recent work with LINQ and knowing that both Scott Guthrie and now Phil Haack are on the team inspires more confidence.
Until they release a CTP and a timetable however this can’t be seriously considered especially for projects that need to start soon. I’m hoping we’ll see a similar cycle to the AJAX and Control Adapters where early access & final versions were available that hooked in to currently shipping versions of .NET and Visual Studio so that we’re not waiting for .NET 4.0.
RC3 was released the following day. Check out the contents or download it.
[)amien
Investigating MonoRail
Fighting WinForms
I hate fighting with a technology to get it to do what I want because it means I either have the wrong expectation or wrong technology.
With web development I expect strict web standard support and clean code that is easy to maintain.
I am, therefore, tired of fighting with WebForms and seeing as I’m not prepared to change my expectation then the technology must change.
Looking at MonoRail
Ruby on Rails is very fast, elegant and powerful but comes with a bunch of unknowns. The IDE’s I’ve tried have been so-so, there is no support for IntelliSense so I’m forced to remember exact property and method names. There are concerns about performance and scalability and I find the Ruby language itself cryptic.
My current .NET environment has all these things, so what I’m really looking for is an alternative to the WebForms element itself. It also has a powerful framework, tons of samples, and C# is not only enjoyable but very in-demand :)
MonoRail seems to be just what I am looking for but there are a number of things keeping me away. I decided to spend an hour watching a screen cast on WinForms and MonoRail from Ayende @ Rahien’s blog. It calmed some concerns but raised a few others…
NHibernate mapping files
NHibernate provides the core ORM system within MonoRail and normally requires XML mapping files to do so.
I really don’t want or need another abstraction layer here – my tables are freshly modeled and represent my domain classes very well. Rails, Subsonic and LINQ to SQL are all happy to just do it/
Thankfully a project called ActiveWriter gives you a very LINQ to SQL-like experience in dragging tables off, changing names and properties if you want and doing the magic for you.
ActiveRecord template
I still don’t like this mix of static and instance methods providing some sort of split between what should really be two classes but I can live with it.
There is also a Repository<T> option mentioned which perhaps solves this, I shall have to investigate it further.
View engines
There are a number of view engines available for MonoRail but the primary ones are NVelocity and Brail.
As I already have C# and JavaScript in my project and I have no desire to add another language unless there is a good reason to do so. If they want to stop people writing too much view code then what is wrong with a subset of C#?
The template engines also mean giving up strong typing (everything is passed to the view in a type-less property bag accessed with a string key!) and a complete lack of IntelliSense (the demo stalls as fields are mistyped on occasion proving just how useful this is).
HTML injection
Yes, in this day and age HTML injection should be a long-dead concern and yet even the built in SmartGridComponent will happily squirt out data without encoding it and thus allowing data from anywhere to contain HTML ready to be injected into an unsuspecting page.
Ayende has investigated the issue now and is working on getting a fix into the tree.
[)amien