Ruby on Rails: 100,000 morons can't be wrong
Listen to this article
So I have to admit that not only am I a cardpod-carrying member of the apple cult, but lately I've been dabbling in a bit of voodoRuby-on-Rails as well and so-far, me likey. I think it's one of those tools that people will either get or not. If they do, it'll be fantastic; if not...
Rather than give you my personal take on this, I thought I'd take a slightly different approach and get in touch with one of my inner-morons for a more balanced perspective.
Ahem...
I'd like to start by saying outright that I think RoR will be a good fit for most large corporate development shops. I can see it delivering 20x, 30x maybe even 50x improvements in efficiency however I do see some short-comings, probably due to it's relative immaturity when compared with Java.
If you look at most of the projects that are using Rails and Ruby at the moment, the code-base consists of dozens, maybe hundreds or possibly even a few thousand lines-of-code at most; Certainly nothing that compares to the size of projects we are used to working on which are in the order of tens if not hundreds-of-thousands of lines-of-code. But fear not, we have a plan to ensure it's readiness for enterprise use.
We have two choices: develop applications and components on an as-needs basis; or try to build some common infrastructure that all projects can use.
The first option sounds dangerous as it will no doubt lead to everyone doing it slightly differently which in turn leads to lots of unnecessary duplication of effort. So as part of the next project, we plan to produce a framework (Ruts?) that will sit on top of RoR upon which all the teams can build. This way we will have better management and control over the infrastructure.
We'll start by checking the source code for Ruby and Rails into our repository so we can patch them whenever we need to. This means we don't have to wait for patches to become available in production versions. It also has the added benefit that when the API's change our code won't need to be re-factored as a consequence. Isn't open-source great!
Next we'll address configuration. There really needs to be a way to place all the configuration in XML files. XML is, after all, THE standard; we've been using XML successfully in Java for years and everyone understand it. We'll start with database connection details, then move on to other areas. One area of particular interest will be database schema generation. At the moment Rails only supports coding the SQL directly. Unfortunately this doesn't allow us to write database agnostic DDL; enter XML. If we create an XML-based language for defining the schema, we can then generate the SQL for each desired database; heck we can also generate the appropriate Rails model classes as well including relationships, etc.
We'll also need clustering—every enterprise application needs clustering. To this end we'll extend rails—we have the source—to support transparent clustering by sending session state to a master controller server that will then send it to all the nodes in the cluster. This will require serialisation and class version management which ruby already has built-in.
We see other improvements in efficiency in terms of testing. We find that due to the very slow turn-around time of Java web applications, our developers spend a great deal of their time writing tests. Rails on-the-other-hand has such a quick development cycle time that we can dispense with much of the automated testing in favour of manual testing.
Having said that, we have noticed that each time the database schema or configuration changes we have to stop and start the server so we will also include an extension to Rails that looks for changes in the configuration and automatically refreshes rails. Again, once implemented in the framework, each project will benefit.
Another limitation in Rails is the MVC implementation. Again, it's pretty good but it could still be improved. We've known through years of experience now that trying to put all that code into one controller class just doesn't work. Instead we will create command objects, wired together using XML and a generic AbstractController that will read the configuration file and work out what to do. This will be much simpler and we envisage huge time savings as a result.
Also the active-record stuff might be a good starting-point but it will need to be enhanced a bit for real enterpise applications. For a start, what it needs are DAO's, one for each table in the database. Again a few classes in this respect would do wonders for productivity. We might even write some code that could generate DAO's from the schema XML configuration discussed earlier.
Come to think of it, if we had some kind of container, then it could manage all this for us and more including transaction management, dependency injection based off an XML file, etc.
We've also been looking at the query language. It's pretty good but it's not very rich and it's basically just SQL injected into your source. What Rails really needs is some kind of Object Query Language along the lines of hibernate. In fact, because hibernate is open-source, we might want to consider replacing active-record with a hibernate re-write (Rhibernate?)
So, as you can see, with a few little tweaks here and there, Ruby-on-Rails might just be what we need to get our enterprise development teams moving towards Web 2.0. We just need to work out how to get Rational Rose and ClearQuest integrated to generate all the code for us and we're set to go.
Comments
Wonderful!
Posted by: Geert Bevin | November 26, 2005 12:04 AM
you are so completly missing the point of rails
Posted by: Anonymous | November 26, 2005 03:45 AM
And I think you missed the joke behind the post anonymous ;-)
Posted by: PJ Hyett | November 26, 2005 06:50 AM
Very amusing simon. hehehehehe.
I appreciate the clean slate that RoR is, and enjoying avoiding going to the gym by noodling with it instead (if nothing else, then for inspiration).
I enjoy how clean it is for web apps, and am almost tempted to say that it is the cleanest I have seen. But then I realise it was last about 2001 when I built a web app type thingamajig that was as simple functionally as the most complex RoR apps I have seen, so I really have no idea what I am talking about. I'll go back to my cage now.
I just hope that JSR-223 and JRuby will provide some easier mechanisms to hitch our favourite VM and APIs to the nearest bandwagon as is speeds past.
Perhaps we can have a JSR for bandwagon attaching.
Posted by: Michael Neale | November 26, 2005 11:59 AM
Genious.
Posted by: Travo | November 28, 2005 08:17 AM
And if I could spell genius correctly I would be smrat.
Posted by: Travo | November 28, 2005 08:19 AM
Damn.
Posted by: Travo | November 28, 2005 08:19 AM
Funny yes, but I honestly don't know whether to cry or to laugh. This is just sooo going to happen at some shops out there. And most likely I'm going to have to go into some of these shops to clean up the mess. (It's part of ThoughtWorks business model.)
I certainly hope that Rails gets more established before this happens, because this is certainly going to create a huge backlash. That's why I think for now it's probably going to be better to not try to do something really big, instead chip away at these small and neat projects to create momentum.
In some ways Rails is a bit like XP. XP can make teams of good developers become even better. Morons will always, always screw up. Sometimes they will screw up in new and interesting ways or they will screw up in some classical way. Doesn't matter. They'll always screw up.
(Oh and btw, Rails has since 0.14.x had a way of creating database independent DDL. With migrations and everything. Check it out, it's sweet.)
Posted by: Jon Tirsen | November 28, 2005 10:48 AM
And Simon, I just knew you were going to fall for Rails. Ha!
Posted by: Jon Tirsen | November 28, 2005 10:50 AM
"Never, has so much sarcasm been missed by so many, for the entertainment of so few."
;-)
Posted by: Jon Eaves | November 28, 2005 11:01 AM
I don't know what I'm more impressed with: Simon's vision, or Jon's Churchill'esque quote.
Posted by: Rup | November 28, 2005 09:30 PM
Jon wins hands-down :)
Posted by: Simon Harris
|
November 29, 2005 06:48 AM
And, to add to the image, Jon T did a Churchill-esque Victory-Sign-While-Holding-Cigar at me last time we had beers.
Weren't the Swedes collaborators during the war? :-D
Posted by: Josh Graham | November 30, 2005 04:38 PM
Well what do you know? I stumbled on this thread at TSS (http://www.theserverside.com/news/thread.tss?thread_id=37249). The discussion starts of fine revolving around implementing a rails-like CRUD framework in Java and quickly devolves into how best to store configuration: database, XML-files, annotations. Oh my lord!
Posted by: Simon Harris
|
December 4, 2005 01:38 PM