Groovy in Action

Groovy in Action
Authors
Dierk Koenig, Andrew Glover, Paul King, Guillaume Laforge, Jon Skeet
ISBN
1932394842
Published
17 Jan 2007
Purchase online
amazon.com

"... a clear and detailed exposition of what is groovy about Groovy. I'm glad to have it on my bookshelf." --From the Foreword by James Gosling Groovy, the brand-new language for the Java platform, brings to Java many of the features that have made Ruby popular. Groovy in Action is a comprehensive guide to Groovy programming, introducing Java developers to the new dynamic features that Groovy provides.

Page 2 of 2
  1. Editorial Reviews
  2. Customer Reviews

Customer Reviews

Andrew said
I am an experienced java developer and bought this book as a way of learning groovy for a project I was working on. I have not been very impressed with this book. First the good, if you are not very experienced with java and want a full introduction to the language this is probably a good choice. However, I wanted to jump into the language and get working quickly. I think the example online pages at the main groovy are better for this. Also, I found the index of this book pretty bad. I have not read any of the other groovy books, but for people like me, I found the online resources better.

calvinnme said
Groovy brings advanced language features such as closures, dynamic typing, and the meta object protocol to the Java platform, and at the same time makes your codebase smaller and more concise. By concise I don't mean so compact that nobody can understand it. Groovy builds on your existing experience and familiarity with the Java platform and allows you to pick and choose when to use particular tools and when to combine Groovy and Java.

The book begins by introducing you to what you will need to compile and run Groovy as far as jar files and tools. Part one of the book is entirely dedicated to the language basics: syntax, grammar, and typical idioms. The language is presented via a combination of examples and discussion. The descriptions are detailed but are not overly academic. Chapter two is most important here, because that is where many of the examples lie that you will need to come back to later in the book.

Part 2, "Around the Groovy Library", explores how Groovy extends the Java Runtime Environment. Part one of the book demonstrated how Groovy makes commonly performed tasks easier. The second part shows how the same principle is applied in Groovy's libraries, using many of the advanced language features available to let you do more work with less code. Chapter 8 introduces the builder concept, which is one of Groovy's distinctive capabilities, because it can only be implemented in a general library class with a truly dynamic language. There are builders that come as part of the Groovy distribution, and you are also shown how to create your own builders. Chapter 9 covers the object/method pure GDK library capabilities. Chapter 10 goes covers Groovy's library support for dealing with relational database systems, providing great flexibility when necessary, and significant shortcuts when simple solutions will do. Chapter 11 presents various methods of making Java applications more dynamic by integrating them with Groovy. I found this to be one of the book's most useful chapters, but you need the first 10 for chapter 11 to make sense.

Part 3 supplies guidance on how to best apply your new Groovy knowledge to practical tasks. Chapter 13 reveals tricks of the trade - how to avoid common errors, using snippet collections, and command-line and automation support. Chapter 14 is about unit testing. I just skimmed this part since the subject doesn't appeal to me. Chapter 15 takes Java and Groovy to the Windows platform. It shows how to put Groovy's expressiveness into action for the automation of Windows controls and applications. Finally, chapter 16 looks at Grails and shows how it leverages J2EE, Hibernate, Spring, and Groovy to allow rapid application development.

This book is a great introduction to Groovy, and even at its rather advanced age for a programming book it is still the best of the Groovy introductory texts. However, I am a person who needs an extreme amount of examples to really get something. For that reason I also highly recommend Groovy Recipes: Greasing the Wheels of Java (Pragmatic Programmers). What this book lacks in examples that book has. What that book lacks in detailed explanation, this book has. Thus they go hand in hand extremely well.

Penguinns said
Highly recommend the book to those starting to learn Groovy and as a reference for those that are somewhat familiar with it.

Ning Zhao said
I feel like Groovy is like a programming language "Eintopf", it aggregates some best characteristics of a variety of programming languages. No matter which programming style you prefer - procedural, functional, object-oriented, meta-programming, static typed, dynamic typed... - Groovy has much to offer. The most beautiful thing is, you can easily combine different programming styles in one language and write most concise and self-explanatory code to solve your problem. With Groovy, you suddenly have so much mind-freedom, you have the choice of expressing your algorithms as close to the nature of the problems as possible.

There are languages having very concise syntax but the code is not easy for human to read. There are languages and APIs require more strikings on keyboard than thinking. Groovy is different. You have all kinds of syntax sugar while the code still tells a literal story in your problem domain.

The only fields I think Groovy might not be suitable are the machine-level infrastructures and image/audio/video processing. C and assembly languages are not replaceable by Groovy. In most other application fields, using Groovy can dramatically boost programmers' productivity and reduce programming errors.

I started off by simply renaming all .java files in my test packages to .groovy files. Worked. Then tried out it's closures and curry calls. For me there are a lot more to explore. Haskel fans will like Groovy. Smalltalk fans will like Groovy. Python fans will like Groovy. Lisp fans maybe too. Java folks? I for one, have already been conquered. If you program at all, by all means do yourself a favour and have a look at Groovy.

Groovy in Action is an excellent book on Groovy and programming. Get this book and get the insight, you'll be glad you do.

Daniel Sline said
For those of you who haven't heard of Groovy, Groovy is a scripting language that is built on top of Java. Since it is written on top of Java, a Java developer can pick up pick Groovy in a snap.

I first heard about Groovy In Action (also known as GINA) during a Groovy presentation almost a year ago, the presenter was referring to Groovy In Action as one of the best references out at the time, After reading GINA, I was not disappointed. The roadmap given at the beginning of the book is a great guide to see how the book is organized out. As an added bonus, the book includes some great reference information at the end of the book. It contains Groovy Language information, a GDK API quick reference, and several great cheat sheets for items such as closures, lists, etc.

The book is full of great examples that you can use (some of the examples illustrate some of the finer points of the language).

In fact someone recently asked about where to find a complete specification of the Groovy Language. Guillaume Laforge, Groovy Program Manager and co-author of Groovy In Action, responded that the most current information can be found in Groovy In Action (source [email protected] mailing list 3/16/2008).

Groovy in Action is one of the Groovy books that is a must have for anyone looking to get into Groovy Development.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne