Tuesday 11 January 2011

Grails in Action



Grails in Action
| 2009-06-28 00:00:00 | | 0 | Grails


For web developers used to wrestling with Java and XML, Grails is a breath of fresh air. Developers are instantly productive, picking up all the benefits of the Ruby-based Rails framework without giving up any of the power of Java.

Grails in Action is a comprehensive look at Grails for Java developers. It covers the nuts and bolts of the core Grails components and is jam-packed with tutorials, techniques, and insights from the trenches.

The book starts with an overview of Grails and how it can help you get your web dev mojo back. Then it walks readers through a Twitter-style social networking app-built in Grails, of course-where they implement high-interest features like mashups, AJAX/JSON, animation effects, full text search, rounded corners, and lots of visual goodness. The book also covers using Grails with existing Java technology, like Spring, Hibernate, and EJBs.



User review
The concise definitive guide to Grails
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.

User review
Well written and thorough and up-to-date
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.

User review
very thorough and gets you from 0 to app in 400 pages
I enjoyed this book and learned everything i thought i needed to know to start building robust grails apps

User review
Grails developers spoiled for choice
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.

User review
The best way to get started with Grails
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.


Download this book!

Free Ebooks Download

No comments:

Post a Comment