Holy Guacamole Web Development With Grails

I was original going to name this post Agile Web Development with Grails but I didn’t want Dave Thomas to send me a cease and desist notification like DHH sent the Grails developers back when it was known as Groovy on Rails. For those that didn’t notice, I was trying to be funny in my last comment but at the same time trying to make a point made by others, that the Grails framework borrows heavily from Ruby on Rails. Like Ruby on Rails, Grails is a Model2 based agile web development framework that strongly favors ‘code by convention’ and makes use of great AJAX libraries such as prototype and Yahoo! UI library. In fact, looking at a Grails directory structure one is reminded of Rails. One key difference between Grails and Ruby on Rails, is that Grails is based on a Java EE stack. In Grails the model and controller classes are written using the Groovy programming language. Groovy is a a dynamic scripting language designed for the Java platform.

As a developer, I could care what language I use as long as I gets paid. I am not a designer so I could care less if my code looks pretty especially since I could always reformat and refactor the code. What my boss is going to want is that the framework I use works well with our current Java EE application and the thousands of classes we have already written. In our case, we already make heavy us of Groovy so it is easy for my boss to buy into Grails. Grails is an easy way for Java developers to get the same productivy experienced by Ruby on Rails developers. With Grails you can easily make use of all of the great class library available in Java and unlike other Java web frameworks like RIFE and Struts, Grails abhors XML configuration files.

Getting started with Grails is extremely easy. Just download and unzip Grails and add a GRAILS_HOME environment variable. That is it. You don’t even have to configure any database configuration, because Grails can read your mind. Well, not really, but Grails comes with an in-memory database already configured in development mode. Just create the domain model class and controllers using generators and that is all.

For non Java developers, I think Grails will be more difficult than Ruby on Rails. For one, I have had difficulties trying to debug Groovy code before. Secondly, the when something goes wrong the stack trace is difficult to decipher. Grails has auto-reload support but that still has some quirks. I’ve had to restart the server because I removed a field from my domain model class.

Now, because everyone always asks, what about performance? I attended the Rapid Web Development With Grails session at JavaOne. I wrote about Grails performance in my coverage of the Grails session at JavaOne.

Technorati Tags: , , , , , , , ,


Leave a Reply