- Paperback: 520 pages
- Publisher: Manning Publications; 1 edition (June 28, 2009)
- Language: English
- ISBN-10: 1933988932
- ISBN-13: 978-1933988931
- Product Dimensions: 7.4 x 1 x 9.2 inches
- Shipping Weight: 1.9 pounds (View shipping rates and policies)
- Average Customer Review: 14 customer reviews
- Amazon Best Sellers Rank: #1,918,135 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Grails in Action 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
The Amazon Book Review
Author interviews, book reviews, editors picks, and more. Read it now
Frequently bought together
Customers who bought this item also bought
About the Author
Glen Smith has been involved in the Grails community since Grails 0.1 and launched the first public-facing Grails app (an SMS Gateway) on Grails 0.2. He is a regular on the Groovy and Grails speaking circuit, the co-host of the Grails podcast, and the man behind groovyblogs.org.
Top customer reviews
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:
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?
(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.
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").
(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.
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.
The book's great strength is its organization. There's all kinds of online documentation for Grails, including a decent reference manual at grails.org, but searching through the mailing lists and the JIRA when the framework does something unexpected is no fun at all. Grails in Action starts off right with a primer on Groovy (which I found refreshing, even though I've read Groovy in Action), then jumps into practical Grails concepts, which it teaches by example. (The central project of the book, a low-budget Twitter clone, is an excellent showcase for Grails.) The later chapters introduce advanced concepts that are extremely useful but not covered (or not covered well) in Grails' documentation. For example, Chapter 13 tells you how to improve database performance by setting up and enabling EhCache; how to use p6spy and sqlprofiler to easily time your database queries; and how to migrate your database using Liquibase. Other chapters talk about concepts like REST and JMS with surprising clarity.
Whether you're a beginner or an experienced Grails developer, I'd say that this is the only Grails book you need.
Given that this book took some time to write and given how quickly the Grails framework evolved during its creation, it's no surprise that this book has these kinds of errors but these should have been caught when the book was still in galley sheets, not be me more than two years after it's third "corrected" printing at the end of 2010. There simply is no excuse for Manning to publish a book that purports to instruct the reader in using Grails v. 1.1 without someone first actually working through all of the examples and verifying that they actually work.
In short, if you want to learn how to use Grails, this book will do the job, but be prepared for the struggle that is to come. Hopefully, the forthcoming second edition will have fewer errors.