Friday, August 03, 2007

Grails more Productive than Rails? Surely not you say?

Software consultancy ALTERthought posted an analysis of their discovery that Grails is more productive (for them) than Rails. Queue outcry from the Rails crowd including the usual "You stupid Java guys, what the hell do you know" kind of commentry. All rather entertaining.

Of course, having done my bit of Rails dev I don't actually believe that Grails or Rails are more productive than each other if you're using purely Groovy (in the case of Grails) or purely Ruby (in the case of Rails). In fact Rails might still have the edge here due to its greater maturity, nevertheless if you're mixing Java into the picture their is really only one winner. This is what the ALTERthought guys have discovered on their Fortune 200 Grails project.

It is of course a growing trend. More and more and more consultancies are discovering that Grails is easier to integrate with existing Java and legacy systems. With Grails you can do things like:
  1. Use an existing Hibernate domain model written in Java and still get the benefit of dynamic finders, persistence methods etc.
  2. Re-use existing Spring services as Grails built entirely on Spring with all its enterprise application integration goodness
  3. Leverage an array of enterprise proven technologies such as Sitemesh, Quartz, Lucene, Compass ... (this list could go on)
  4. And in the upcoming 0.6 release, thanks to contributions from JetBrains, you can jointly compile Java & Groovy and have circular references between the Groovy and Java code (a Groovy class is just a Java class after all)
People of course automatically raise the JRuby on Rails argument, but as of this writing you can't do 1) or 4) of the above list whilst 2) requires some trickery.

The other revelation that Java people are discovering is that they no longer need to abandon their existing Java knowledge to get RAD development. The Java platform now has its answer to Rails, why go else where?

10 comments:

Marc Lester Tan said...

Before I learned about grails, I was using Struts 2.0 and I am almost spending 2 weeks in my project. I partly finished it. Already built my domains, actions and a few pages. And then I tried reusing my domain classes in grails and it just works. In just 2 days, I got my whole application working with only just a few tweaks remaining. Simply Amazing :)

Anonymous said...

As I know, you have the same adventages using JRuby on Rails, no?

Graeme Rocher said...

As pointed out in my blog, there is not nice integration with JRuby on Rails and Hibernate and there is no possibility of joint compilation

Also Groovy support annotations and generics so is easy to integrate with Java EE

Anonymous said...

I am part of the team that is using Grails in the referenced post (Indeed, I posted a similar comment on the ALTERthought blog)

All learning curve issues aside, one of the biggest motivating factor for choosing Grails over other options (like Rails) were the options it provided with regard to enterprise development. Notably having to integrate with a load of legacy datasources, message queues and the like. Knowing that I could always revert to what I knew would work (i.e., Hibernate, Spring, etc) is a nice safety net.

I am sure its possible to do the same things with Grails, but it seemed like much more of a science project then our initiative could afford.

Graeme Rocher said...

I assume you meant Rails in your last sentence ;-)

Graeme Rocher said...

Great, well keep us up-to-date with the project's progress and if you have any feedback on improvements we can make feel free to raise them on the Mailing list or JIRA.

Cheers
Graeme

Anonymous said...

Oooooh! I am psyched to hear about (#4) the circular references thing!

I saw your (pre-)JavaOne presentation on Groovy, and I was excited then and am doubly so now...

Now, if I could just find the time to play with all these technologies, I'd be a happy guy... :-)~

Anonymous said...

As usual your post is logical and level-headed. I don't know why people get so emotional about this. It's simply a matter of choosing the right tool for the job. As a JEE guy, Grails is the sensible choice. Grails' (and Groovy's) greatest strength is its integration with Java and Java-based technologies, and for this reason I believe Grails adoption will increase rapidly. Choosing a non-Java based framework like RoR would be silly for what I do. I might as well pick .Net. Maybe they should have a Nobel prize for application frameworks? Grails would win hands down. Hey, why don't they have a Nobel prize for Computer Science anyways?

Anonymous said...

Having used both rails and recently grails I can honestly say the rails blows grails off the face of the earth. It's more mature and vastly simpler to use. I dont care if I can use an already existing hibernate model, I dont need to rails makes it so simple to create the models it's not really any work to recreate it in no time if I had too.

As Jruby comes along, and it is coming along very quickly along with the rails jdbc and Goldspike stuff, I will use that going forward when I need the ease of use of a rails like framework within the confines of java. Grails is not the java answer to rails, JRuby and rails will own this space in no time.

Graeme Rocher said...

Sure its more mature, but we'll get there. And asked anybody "experienced" in using Grails and Rails and they'll confirm Rails is not orders of magnitude ahead.

Grails provides different things not available in Rails like stateful web apps, property transaction support and legacy integration.

As for your post, its the same usual drivell from a member of the Rails crowd. Those who actually care about doing web development on the Java platform aren't using Rails