Book review: Groovy Recipes

how-to
Feb 22, 20092 mins

While Groovy can found existing in one jar file, it is a large platform with a plethora of features and tricks. In fact, Groovy in Action

(for which I had the pleasure of participating in) weighed in at almost 700 pages. Consequently, Scott Davis’s Groovy Recipes: Greasing the Wheels of Java
is a handy light-weight (roughly 250 pages) reference bag of tricks suitable for any Groovy developer’s desk (beginner to expert, baby).

Scott starts out answering the questions any beginner would ask — for example — how to use groovysh, groovyc, Groovy with IDEA (my preferred IDE!). He then proceeds to explain the core of Groovy — the syntax magic, operator overloading, and native collections to name a few goodies. Chapter 4 is particularly hip as it covers the tight relationship Groovy shares with Java, which always comes up when bringing the good news of Groovy to Java developers.

Scott spends two chapters covering XML — both parsing and creating it. If you haven’t seen Groovy’s <a href="<a href="https://thediscoblog.com/2008/03/20/unambiguously-analyzing-metrics/">https://thediscoblog.com/2008/03/20/unambiguously-analyzing-metrics/</a>">XMLSlurper</a> in action, you are in for a real doozy, baby! After that, Scott covers file tricks, the command line, and web services in Groovy– something that I’ve fully embraced Grails for. By far, my favorite chapter though is chapter 10 — Metaprogramming — which exposes the magic behind everyone’s favorite web framework: Grails. Metaprogramming is where Groovy really shines and this chapter is bound to wow a few hip souls.

The book finishes up with two chapters focused on Grails– while there are entire books written on the aforementioned subject, Grails can be covered at such a high-level quite nicely. In fact, in chapter 11 alone, you’ll have a working Grails application up and running!

All in all, my friend Scott does a wonderful job of distilling what’s a large copasetic platform into a practical bag of tricks appropriate for Java developers looking to jump into Groovy and even those in the Groovy community that need a quick reference nearby.

Want to learn more about Groovy and Grails? Then sign up for ThirstyHead’s Jump into Groovy and Grails course!

Think easyb is the coolest thing since sliced bread? Then come to my

BDD with easyb

course too!

andrew_glover

When Andrew Glover isn't listening to “Funkytown” or “Le Freak” he enjoys speaking on the No Fluff Just Stuff Tour. He also writes articles for multiple online publications including IBM's developerWorks and O'Reilly’s ONJava and ONLamp portals. Andrew is also the co-author of Java Testing Patterns, which was published by Wiley in September 2004; Addison-Wesley’s Continuous Integration; and Manning’s Groovy in Action.

More from this author