Book review: Grails in Action

Z Jacek Laskowski - Wiki Projektanta Java EE

Grafika:grailsinaction_cover.jpg Grails in Action by Glen Smith and Peter Ledbrook (Manning, May 2009)

I was very pleased when I received a copy of the Grails in Action book by Glen Smith and Peter Ledbrook from Manning. I heard that it was really a good book and it didn't take long to prove so. It's my fourth book about Grails after Beginning Groovy and Grails: From Novice to Professional, The Definitive Guide to Grails, 2nd Ed. and Grails 1.1 Web Application Development, so I didn't expect much new. It was meant to be a time well spent with Grails which I'd thought I'd already knew. I couldn't have been mistaken more.

I started reading the book right after having finished "Grails 1.1 Web Application Development" from Packt and if I had to suggest any reading order it'd be exactly as I followed with a small exception of "The Definitive Guide to Grails, 2nd Ed." being before the last one, i.e. "Beginning Groovy and Grails: From Novice to Professional", "Grails 1.1 Web Application Development", "The Definitive Guide to Grails, 2nd Ed." and "Grails in Action" for letting your Grails knowledge settle down a little. If you don't fancy reading books you can even skip the first two and rest assured you will get much if not all about Grails. They're written by people who not only participate actively in Grails development itself, but even know how to write about it with much fun.

Glen and Peter are active Grails developers. They write about themselves "we're practitioners, not theorists" (page 66) so it shouldn't come as a surprise that their book is all about what every Grails practitioner would anticipate and appreciate - what Grails is, how one should approach Web 2.0 projects with it under his/her belt and how to extend its capabilities while developing "a simple microblogging application in the style of Twitter". There're a lot of pages how Grails works behind the scenes without more ado. Every piece of Grails is laid out and discussed with enough details to make anyone a Grails pro. Every now and then, they point out an interesting piece that can only please readers by giving them what one must otherwise have dug in the Grails sources. It's succinct and to the point. It kept me reading for almost a week and each and every chapter gave me more and more reasons to develop applications in Grails only (it scares me a lot too, to be honest). Not only do the authors mean to present all the Grails features, but they do it with a great sense of humour. One of the most valueable parts of the book are the tests to show how exactly a given feature works. Hate it or love it, but the authors drew enough attention so they're not forgotten as a good practice in our development endeavors. There're lots of unit, integration and even integration tests. I must also admit that some parts of the book I didn't like much. I'm not really sure if it was because I was simply swamped with the intricacies of Grails or the pace which I considered too fast in some parts of the book or yet it was something else not necessarily Grails-wise. Even though there were pages I didn't like I couldn't resist reading the book further.

"Grails in Action" is made up of 4 parts. The very first one is to introduce you to Grails as a web framework developing a simple web application with scaffolding and other basic stuff accompanied by the chapter about Groovy, the Grails language. It could seem it is not worth its time, but I strongly recommend reading it. It is not just an introductory material for newbies, but comprehensive introduction to Grails basic features and Groovy. Part 2 covers core Grails features like domain classes, controllers, views, taglibs (with iteration tags), command objects and services whereas Part 3 uses plenty of plugins for real Web 2.0 application development. Part 4 is not meant for faint-hearted and describes the Grails foundation - Hibernate and Spring Framework - focusing on their use by Grails. The chapters begin with a very short and concise introduction to the features at hand, say 2-3 pages, and out of the sudden you're engaged in a real Grails development. 15 or 20 pages after and you're out with a couple of guidelines to wrap things up, ready to roll your sleeves up and dive into projects hoping Grails will make them finished faster.

Even after "The Definitive Guide to Grails, 2nd Ed.", you can find a lot about Grails and it's hardly possible not to take some additional notes. I'm used to take some and believe me or not, that book made me stunned for quite a while very often. I thought no other book could've beat "The Definitive Guide to Grails, 2nd Ed." by Graeme Rocher and Jeff Brown, which is truly the definitive guide to Grails, but it was just "Grails in Action" which I read with my mouth opened experiencing the beloved "Aha!" moments quite often. It is now my book number one about Grails 1.1. With the recent changes in Grails 1.2 I hope it's not the last book by Glen and Peter.

Osobiste