found drama

get oblique

Grails in Action

by Rob Friesel

Not necessarily the front-end developer’s primer…

Rated ★★☆☆☆ on the Goodreads scale, and ★★★☆☆ on the Amazon scale.

Not to be too much of a self-apologist, but let me preface this review by indicating that my frustration (and hence my lower rating) comes largely from gaps in my own knowledge. But as a result of those gaps, I wasn’t able to reap this book’s full benefits. So first, what was my impression:

Grails in Action is a fast-paced overview of the Grails platform, with an even quicker overview of the Java-based Groovy language that powers it, and some at-a-glance discussions of some other underlying frameworks and technologies (e.g., Spring, Hibernate, SiteMesh). The book’s approach is to take you through the platform in a learn-by-doing approach, walking you through the major language features by building an application in Grails that takes advantage of all (or at least most of) its major features. By building the application alongside the authors’ text, you get yourself familiar with those features, their syntax, and the philosophy behind it all.

Sounds great; but, a brief segue on why I didn’t reap the full benefits:

My work is mostly on the front-end, and over the past couple years I’ve been writing object-oriented JavaScript almost exclusively. But as Grails has been getting introduced into the mix for a lot of new projects, it was time to dive in. And despite my excitement about making the transition into a more full-stack role, my day-to-day would still be mostly on the front-end. When Grails got onto my radar, I knew right away that most of the work I would do was going to be in the controllers, views, and layouts. So that’s what I wanted to learn about; I wanted the best possible introduction to Grails for front-end engineers.

So why the disappointment? Grails in Action wasn’t really written for front-end developers. I suppose I could have figured this out if I’d taken a look at the pedigrees of either of the authors–there’s a lot of Groovy and Java there. But that colors the approach, and when they say “previous experience with Java web development is an advantage”–they mean it. Not knowing Java–and/or not doing much work on the band end–will slow down your understanding.

With that out of the way, what were the good and the bad?

THE GOOD

  1. I agree that the “learn by doing” approach is the best way to go. Nothing helps it “stick” quite like getting your hands dirty. That said, this particular learn-by-doing was a strange mix of hand-holding (e.g., “Right, OK that was obvious.”) followed by cavalier glossings-over of other aspects (e.g., “Wait–what?–where did that come from?”).
  2. Part 1 (“Introducing Grails”) and Part 2 (“Core Grails”) are fantastic overviews of the core “90% of your time” features in the Grails platforms. There are some outstanding and very clear explanations of those features, the philosophies that guided the implementations of those features, and how best to apply them in a given context. By the end of Chapter 6, you’ll be in a decent position to start banging away on your own apps.
  3. The chapters on build systems, writing your own Grails scripts, and plugin development are very informative and show the kind of real power that lives under the Grails covers.

THE BAD

And/or, the critiques both big and small, and a few other things that couldn’t be helped:

  1. The Grails community is moving fast, and though I would not call the book “out of date”, there were some quirky differences between Grails 1.1 (the current version when they wrote it) and 1.3.5 (the version I had installed during my reading). One example that came up during the first chapter: their exercise on pages 19-20 said to type new Quote when what was really needed was the namespaced version new qotd.Quote.
  2. As I already mentioned, the emphasis on the book is much more about what’s going on in the back end and so front-end developers (like myself) may find themselves a bit lost or otherwise not getting what they came for. The authors write “some experience with web development (in particular CSS, HTML, and JavaScript) is assumed”–but I felt like you could get by without really having much more than a cursory knowledge of these. (JavaScript and CSS really didn’t come up in any substantive at all.)
  3. There’s an awful lot of time given to writing tests and testing. OK, I get it–testing is important and can help you save yourself from yourself. But there were quite a few features of the language that got not-as-much (e.g., “At what point is UrlMappings.groovy parsed? processed? How does that work?”) or else not-at-all (e.g., “What’s supposed to go in that src/ directory?”) coverage that would have been nice to see instead of that whole chapter on testing.
  4. Plugins, plugins, plugins… Again: “OK, I get it…” As a platform, Grails is all about plugins–it’s a conglomeration of plugins to start with, and it has a vibrant community of plugin writers. And that is marvelous. But once plugins are introduced (in (surprise!) the chapter on tests and testing), every chapter after that includes a line that reads grails install-plugin name-of-plugin. Perhaps that is (shall we say) idiomatic Grails development, and perhaps the implied take-away is “install the plugin and examine its source code”, but that time might have been better spent discussing the problem and the “how” of the solution instead of just dropping one in.

TO CONCLUDE

I would stand by Grails in Action as an excellent primer on the major features of Grails, and its hands-on approach should help you get comfortable with the key features quickly. But if you’re a front-end developer looking to get started with Grails, this probably is not the best introduction. It seems to skip over some aspects of the platform or else give only cursory explanations, but then it spends a lot of time talking about and working with domain classes and the technologies behind them. Again, this is probably fine if you’re already a seasoned Java or Groovy programmer on the back-end, or already fancy yourself an adept full-stack developer–but if you’ve spent most of your time in the browser, you may find it tough to wade through some of what’s in here.

For my money, I’m still looking for that good introductory book on Grails. Grails in Action was worth the read, but I think I’ll need to give it a second pass after I’ve found my feet.

About Rob Friesel

Software engineer by day. Science fiction writer by night. Weekend homebrewer, beer educator at Black Flannel, and Certified Cicerone. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*