rank trend

Grails in Action

by Glen Smith, and Peter Ledbrook
Released 2009-06-28
Read articles about Ruby
Buy it from AmazonNew for $29.69

8 Reviews

Sort by: Most Helpful ▲ Date Rating

5 stars The best way to get started with Grails

2009-07-13     9 of 9 found this review helpful

I've read both this book and the older Definitive Guide to Grails, Second Edition, and I'm happy to report that Grails in Action is both more concise and better-organized than that other (nonetheless excellent) tome. It is also slightly cheaper and, until Grails 1.2 is released (it's in early milestone as of this writing, so I wouldn't expect it to be production-ready before 2010), pleasingly up-to-date. There are very few errors, and if you find any, the authors will be happy to help you sort them out in the book's official forum.

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.

5 stars An Excellent Book!

2009-07-01     8 of 8 found this review helpful

I've written this review on my blog, reproducing it here:
-------

The book is organized into four parts:
* Introduction: The very first chapter is aptly titled as `Grails In a Hurry'. If you are a complete beginner to Grails you will be blown away with the productivity and the powerful feature set of Grails on display. Many concepts explained in detail in the later chapters are summarized with a simple example. Second chapter goes over Groovy basics, which is adequate.
* Fundamentals: I think taking up a non-trivial example to explain the concepts of a framework is nice. A Twitter-like application is built during the course of this part of the book. This part explains about using GORM (Grails Object Relational Mapping Library), techniques for using Constraints for validation, power of Grails scaffolding, usage of dynamic queries, controlling application flow and the usage of services, introduction to GSPs and the discussion about views and layouts (along with AJAX stuff).
* Building more features into your applications: How well different levels of testing (unit, integration, functional) are integrated into the framework is discussed. This part then continues with the basics of plugins and their usage. One of my favorite chapters in this book follows next, workflow with Grails Webflow. Security is discussed in some detail, but the chapter that follows really stands out (especially for a huge REST fan like me) -- explains how to design and implement a RESTful API showcasing Grails support for this architectural pattern.
* What you need to know for real work: The last part of the book explains about -- messaging and scheduling, some advanced GORM concepts, how to use Spring and transactions with Grails, and about plugin development. The chapter on advanced GORM concepts is well written; folks who intend to use Grails for enterprise-level applications will certainly benefit from this chapter.

This is my first formal reading of a Grails book, but have some decent exposure to the concepts of Grails (from the available documentation, and by the presentations that I attended in the past). So for me, introductory chapters and some of the fundamentals are well-needed refreshers, but the last two parts really stand out. Some points from my notes:
* For integration tests, Grails bootstrap the database and wires up all components just as it would for a running web app.
* Domain class relationships (1:1, 1:M, M:N) are explained quite well from the Grails point of view -- belongsTo variations, hasMany and GORM magic of automatically adding new methods to account for the defined relationships.
* Groovy querying with dynamic finders: Dynamic finders take advantage of funky Groovy metaclass magic to intercept all method calls on a domain object; leverages Groovy's methodMissing feature.
* Use flash scope for passing messages to the user when a redirect is involved.
* Extensive discussion on the Grails form taglibs, and on creating your own tags.
* Mocking is built-in the framework for productive unit testing.
* Webflow introduces a new scope: flow scope. Items put in flow scope live for the life of the flow. Favor flow scope over session scope -- Webflow will cleanup the storage for you and give you more efficient server memory.
* The chapter on implementing the REST architectural pattern is a must read; Grails supports the pattern out-of-the-box.
* Grails uses OSCache as its default cache library (for Hibernate's second-level cache). The reason suggested was that it plays well with Grails developer restarts, something I would like to understand further in reference to Ehcache. But the authors actually used Ehcache in the book suggesting that it is a better library (I agree!).
* So easy to declare caching at the domain level:
static mapping = {
cache: "read-write"
}
* Discussion on integrating with legacy databases is interesting, but would like to see some case studies to understand the real pain involved.
* Transactional services are implemented using Spring's AOP mechanism (Spring's TransactionProxyFactoryBean).
* Integration tests run inside a transaction by default, which is then rolled back after each test finishes. This ensures that data changes don't affect other tests, but it means you can't check whether transactions are rolled back or not. If you want to test transactional behavior then you need to add a static transactional property to your test.

Conclusion
----------
The book is very well organized and the topics chosen are well thought of. An easy conversational tone is used through out the book. In my opinion, this book succeeds in building a sustained interest about the framework. It is also an excellent reference book on the topic. Strongly recommend the book for all Grails enthusiasts.

5 stars Grails developers spoiled for choice

2009-08-03     6 of 6 found this review helpful

I've been following Groovy and Grails books for a couple years now, and own nearly all of them. Each one has filled a niche, and almost all have been great in letting the voice of the authors come through while keeping the style of the publisher (Manning books have a different feel from Apress, for example).

I had high hopes for this book, and wasn't disappointed. It had tough competition from the recent The Definitive Guide to Grails, Second Edition (Expert's Voice in Web Development) but I think this book *slightly* edges out that one as a Grails resource. Why? It's slightly more up to date, for starters. The chapters on dealing with legacy databases and on adding security to an app were both a bit more informative, or at least I found them a bit easier to follow. This is not to detract from the DGG. If you *can*, I'd recommend owning both, as each presents similar information in a unique style. The Grails in Action book feels somewhat more conversational, which made the reading easier for me.

There's a lot more substance other reviewers have given on this book - I'm not sure I'm going to go in to as much detail as they have. Suffice it to say that this is currently my book of choice for working with Grails these days. Glen and Peter have packed an incredible amount of information in to 500 pages, with concise writing, useful examples, and just enough humor to keep it entertaining without losing its utility.

For most of 2008, I was recommending Beginning Groovy and Grails: From Novice to Professional (Beginning from Novice to Professional) from Christopher Judd and company. For my money it was *the* book for 2008 for Grails developers. I think given the advances in the past several months, both the new DGG and this new Grails In Action book deserve to share the title of "Best Grails Book". You can't go wrong with either book.

As an aside, I'd also recommend Groovy and Grails Recipes from Bashar Abdul-Jawad if you're looking for a companion piece to Grails In Action. It provides a 'recipe' approach to quickly finding the code snippets you need to solve a particular problem.

5 stars The concise definitive guide to Grails

2009-09-24     4 of 4 found this review helpful

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.

5 stars Well written and thorough and up-to-date

2009-08-18     4 of 4 found this review helpful

I have had issues with other Grails books being out of date (not this book). One book I was reading had been written for Grails 0.5 or so, and I spent about 3 weeks with it ... before giving up (things have just changed enough in Grails that I could not get their examples to work).

I did not run into that issue with this book (this was the 3rd book I tried following, the 3rd time was the charm). The downloadable associated code was written for Grails 1.1.0 (I think they should update it to 1.1.1, but it did not cause me significant problems).

The writing style is refreshing, not really boring "computer book" prose ... but more of a story telling style, yet not needlessly wordy. This is the type of writing that I would aspire to if I were writing a technical book.

The thing that stood out to me was the depth and breadth of the coverage. The authors take you on the standard Grails journey of using Controllers, Views and Domains and GORM, and Unit and Integration testing with (with JUnit extensions built into Grails), and functional testing with the HtmlUnit plugin.

They then take you on a journey through a large number of the available plugins, which make Grails development very productive. This includes coverage of the Spring Security plugin (acegi), scheduling with Quartz, messaging with ActiveMQ, a chart drawing plugin from Google.

They also take you through implementing a REST api.

They finally take you through the process of developing your own Plugin.

So, as I said ... the breadth of material is excellent, and the details given to allow you to use that breadth of information is also top-notch.

One minor issue I have, relates to a strength of the book as well. They include source code and then a commentary on the source code. They don't go into nauseating Deitel-like description of "here we add 1 to the variable", but there are some comments that would probably have been better left out.

2 stars Not recommended

2010-07-21     0 of 0 found this review helpful

This book starts out with a clean, easy example. But by the time one gets into the thick of things, he/she will quickly come across a lot of minor errors, but more importantly, large gaping omissions. The source code is available for download, but without code explanations in the book, it's extremely difficult to follow. I would not recommend this book to anyone trying to learn Grails from scratch.

5 stars THE Grails Book

2010-01-05     0 of 0 found this review helpful

I bought this book a few days ago and I'm tearing through it! The book is very well written and the idea of including a simple sample app in the very beginning was a great choice. It took me roughly 1 hour to get the Quote of the Day application running. It would have taken half the time but I was playing around with Grails. Truly amazing how productive you can be with groovy/grails.

As always check the Manning homepage and get the errata before starting the book so you don't have a breakdown when some code doesn't work. So far everything has worked out which is highly exceptional in these days of tech book spam.

Bravo!

5 stars very thorough and gets you from 0 to app in 400 pages

2009-08-14     0 of 4 found this review helpful

I enjoyed this book and learned everything i thought i needed to know to start building robust grails apps

Buy it from AmazonNew for $29.69