Saturday, July 25, 2009

Groovy Books

I have been using Groovy to write functional tests for Platypus, the open-source typesetting project I work on. I am likely to make Groovy the default scripting language for Platypus in the next milestone. In the process, I've had to come up to speed on Groovy and I've been reading through and looking over the various Groovy titles on the market. Here's my take.


The Groovy bible today, without the slightest doubt, is Groovy in Action which at 650+ pages is also the most detailed book. Its principal limitation is that Groovy has undergone several revisions since it came out. Because of this, a second edition is being written. Early access to e-drafts of that edition are available here, although little as yet has been published.

If you'd like a shorter and more up-to-date introduction to Groovy, I recommend Programming Groovyby Venkat Subramaniam. At less than 300 pages, it's a quick read, provides all the needed info quickly, and covers all the highlights, with a good balance of detail.

Many people consider Grails to be the killer app for Groovy. It's a web framework that rides above Spring and Hibernate and removes much of the complexity of using those components. If you are learning Groovy to use Grails, then Beginning Groovy and Grailsis an excellent choice. It's clear, approachable, and teaches you enough Groovy to be able to follow the tutorial on Grails.

Once you get comfortable with basic Groovy, you'll quickly find yourself pining for a book of recipes that shows you how to quickly get basic tasks done using Groovy metaphors. There are two somewhat flawed recipe books on the market. The first is Groovy Recipesfrom Scott Davis, a well-regarded lecturer in the Groovy area. While calling itself a recipe book, it frequently diverges into tutorials and odd humor--both of which are obstacles when trying to find information. Some important topics are not covered at all, such as testing--which is one of the major areas where Groovy benefits Java. Database access is also not covered. In other areas, Davis' explanations seem to lack an understanding of what the user would be looking for. Nonetheless, I have successfully used some of Davis' recipes in my work. A good alternative is Groovy and Grails Recipesfrom Bashar Abdul-Jawad. This title is a true recipe book and very readable. The Groovy portion is too short, however, and an important section on file recipes (which does appear in the Davis book) is omitted. However, if you're learning Groovy to get to Grails, this is the best choice. And Abdul-Jawad does a good job understanding what readers are looking for.

Ideally, O'Reilly would publish one of its trademark comprehensive recipes book and we could all settle on that. However, when I contacted O'Reilly about upcoming Groovy titles, the company indicated it had none in the immediate pipeline.

That's pretty much it for Groovy books; although there are several others that focus exclusively on Grails. One publisher, Apress, seems to dominate that Grails market. The two titles above that cover Grails are from Apress as is the Definitive Guide to Grails, written by Graeme Rocher, who designed Grails. In the past I've been skeptical of Apress books due to wide variations in their quality, but the Groovy/Grails titles I've examined have been consistently of high quality.

As Groovy gains a wider audience, I expect more titles to emerge from all the technical book publishers.




4 comments:

Anonymous said...

Bbased on the early beta release chapters , I think Dave Klein's Grails will be the best one yet when it releases next month.

Anonymous said...

O'Reilly actually does have a Groovy book in the pipeline, but it's not a recipe book. It's called "Making Java Groovy," and is primarily about Groovy/Java integration. There will be chapters ranging from testing to build processes to web services and more. I know this book is in progress, because I'm the (co-)author. :)

The book is due late this year, hopefully for a January release. Feel free to contact me (ken dot kousen at kousenit dot com) if you have any questions or comments about it.

Ken Kousen

LAKSHMINARAYANAN SESHADRI said...

hi,
i have been reading your reviews and articles on various things like java IDEs and dynamic scripting languages in JVM/.NET.
I have precisely 2 questions:

i) Where does python and JVM port of it Jython which is extensively used as JMX client browser and admin scripting tool in popular middleware like weblogic. Also your views on Guido 's well though python language and its ports on JVM/.NET future compared with Ruby/Groovy

ii) JDeveloper -how does it compare with eclipse,netbeans or others in ides

Andrew Binstock said...

@kousenit Thanks for the update. I'll look forward to your book.

@lakshminarayan 1) one of these days I'll blog on this. It's a long answer. I chose Groovy after evaluating alternatives because: a) I like the meta-programming features; b) it integrates natively with the JVM and can be called using JSR-223; c) good IDE support; d) thriving, very helpful community. I don't use Python; and at the time I was making my choice for Platypus, Jython was essentially dead. As to the IDEs, I have consistently praised Oracle JDeveloper. If you google my name and JDeveloper, you'll see the coverage I've given it over the years. My opinions regarding it have remained the same.