Jump to ratings and reviews
Rate this book

Groovy in Action

Rate this book
"... 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. To bring you Groovy in Action, Manning again went to the source by working with a team of expert authors including both members and the Manager of the Groovy Project team. The result is the true definitive guide to the new Groovy language.

Groovy in Action introduces Groovy by example, presenting lots of reusable code while explaining the underlying concepts. Java developers new to Groovy find a smooth transition into the dynamic programming world. Groovy experts gain a solid reference that challenges them to explore Groovy deeply and creatively.

Because Groovy is so new, most readers will be learning it from scratch. Groovy in Action quickly moves through the Groovy basics, including:

* Simple and collective Groovy data types
* Working with Closures and Groovy Control Structures
* Dynamic Object Orientation, Groovy style

Readers are presented with rich and detailed examples illustrating Groovy's enhancements to Java, including

* How to Work with Builders and the GDK
* Database programming with Groovy

Groovy in Action then demonstrates how to Integrate Groovy with XML, and provides,

* Tips and Tricks
* Unit Testing and Build Support
* Groovy on Windows

An additional bonus is a chapter dedicated to Grails, the Groovy Web Application Framework.

912 pages, Paperback

First published January 1, 2007

20 people are currently reading
164 people want to read

About the author

Dierk König

3 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
53 (25%)
4 stars
95 (45%)
3 stars
53 (25%)
2 stars
5 (2%)
1 star
2 (<1%)
Displaying 1 - 23 of 23 reviews
55 reviews13 followers
March 25, 2009
Groovy is turning out to be rally rather interesting.

I remember thinking that I was learning OO back in the 90's and reading GOF patterns Design Patterns book and not really getting the plot. Why did they need Visitors, Observable and Action Listeners. What was it all for?

I understood this later when working with various Java frameworks and was really quit impressed with the GOF's foresight.

Groovy strikes me as this story being repeated. The way that Meta Class Dispatching and Closure can be combined to produce builder is simply brilliant.

The fact that this is all Java compatible and therefore lets you exploit all the huge resource of open source frameworks stikes me as important.

Debugging in Groovy appears problematic though. The stack traces and the error messages are by no means obvious and as we all know, most programmer spend most of their day staring at these trying to understand what they've done wrong or the writers of a library have done wrong.

Open verdict on Groovy as a language yet but Groovy In Action is certainly a decent attempt a explaining and teaching the language/
More later.

Profile Image for Clint Jones.
246 reviews3 followers
Want to read
November 14, 2024
Chapter 1 is a tour that someone already in the know will understand, and a sales pitch
Profile Image for Jean Tessier.
163 reviews31 followers
October 3, 2011
We are using Grails at work. I am using this book as a reference, looking up topics as needed and leafing through it to get a general feeling for the language. Groovy is a lot like Ruby, but with a syntax that is much closer to Java.

I was looking up the -p and -n options to write scripts for processing input files, and I was annoyed that there was no exhaustive list of the resources available to my script as it processes lines. The book mentions line, which holds the current line, and count that counts lines read so far, but what else is there? How about the current filename? Or the line number within the current input file? I had to dig through the source code for Groovy to find out that line and count were all that there was.

There is a second edition planned for middle of 2010. You can get early access copies from the publisher, for a price, as part of the Manning Early Access Program.

The chapter on database support via JDBC shows the massive support for database operations using dynamic features of the language and closures.

The support for XML and HTML using builders is also very promising.

Between this book and the online documentation, I have found answers to almost all my questions.
2 reviews
Read
January 4, 2012
This is a well-written and fun book by the creator of Groovy that allows one to quickly start working in the language.

Why would one want to learn Groovy? Groovy is an extension to the Java programming language that allows one to write simple scripts that are Perl-like in flavor. Suddenly Java no longer feels like a compiled language. Classes may be mutated on the fly: one can add fields and methods during execution. The code is concise, clean, and intuitive. Groovy includes powerful integration with ant, JDBC, servlets, XML parsers and generators --and so on.

Groovy is a strongly recommended extension to the toolkit of any Java programmer and it is very easy to learn.

On the downside Groovy does not stand alone but feels like an extension to Java. One must be well-versed in Java and understand the Java underpinnings to use the language effectively. I don’t think there will be any Groovy programmers: there will be Java programmers who use Groovy.

The most exciting application of groovy to my mind is the grails web framework. This framework has proven itself production ready and is, I anticipate, the wave of the future.
27 reviews
January 26, 2018
If you are a programmer who left for management or architecture, this book will bring back your enthusiasm for coding again as it shows how to lever a Groovy, a powerful dynamic language that makes programming enjoyable again. I found myself thinking of experiment tasks that would allow me to apply the scripting aspects of Groovy to get something working quickly.

The following chapters are the highlights of GINA in my opinion
- Chapter 5. Working with closures
- Chapter 7. Object orientation, Groovy style: pay attention to section 7.3 Advanced object-oriented features particularly the topic on Traits
- Chapter 8. Dynamic programming with Groovy
- Chapter 11. Working with builders: shows how easy it can be working with XML or JSON in comparison with Java
-Chapter 13. Database programming with Groovy
- Chapter 17. Unit testing with Groovy
- Chapter 19. Domain-specific languages
Profile Image for Yamir Encarnacion.
21 reviews3 followers
July 2, 2011
The Good:
This book will teach you Groovy

The Bad:
I thought that the first part of the Book (which teaches you the Groovy Language) was verbose and could have been better organized.

Conclusion:
If part 1 of the book (covering the Groovy Language) had been more concise and better organized I would have rated this book 4 stars. Also, if you are going to buy this book be advised that at the time of writing this review (June 27, 2011) the second edition of the book is available as a preview from the publisher (Manning) and its purchase includes this edition (the first edition).
Profile Image for Tony.
103 reviews
Read
January 2, 2014
I was learning Groovy because the new testing framework we're using at work, Spock, is built on this (as opposed to jUnit, which uses Java).

As with most programming languages, if you don't have time to do the exercises, you won't get much out of it. You have to have time to play with it.

The format of showing a code snippet, with numeric tags applied, then explaining what's going on with each of the tags, is a useful one. Not quite as good as, say, Literate Programming. But still quite useful.
Profile Image for Ivan Idris.
Author 14 books26 followers
December 26, 2011
Groovy is a new programming language, that is based on Java, but has optional dynamic typing. Groovy also borrows features from Python and Ruby. The examples in this book appealed most to me. Even if, after reading this book as a Java developer, you still want to stick with Java, you would have learned just as much about Java as from any Java book. Groovy is after all very similar to Java.
21 reviews8 followers
October 31, 2008
This is still probably the best overall Groovy reference available. It has tons of great information that is hard or impossible to find on the web, and it covers everything from simple, command-line scripting to building web apps with Grails.
Profile Image for Christopher.
3 reviews
April 24, 2013
I don't find this book to be very practical or well organised, although it does give you a lot more background knowledge about groovy than some of the other books. I would recommend "Groovy Recipes" if you want to see groovy in practice.
Profile Image for Richard.
4 reviews4 followers
January 1, 2015
Enjoyed the way all code examples were written using asserts.
Profile Image for Scott.
6 reviews12 followers
April 22, 2011
Great book on a great language!
Profile Image for Trung Vo.
5 reviews7 followers
September 19, 2011
- it's kind of old, it's for Groovy 1.0, hope to see second edition soon
- Good reference for groovy language. Hope to see groovy make it to top 20 language.
Profile Image for Brandon.
7 reviews1 follower
June 28, 2013
Good Groovy book. I have no need for Grails and wished that they would have left that part out.
Profile Image for Anusha.
6 reviews
March 9, 2015
The perfect reference, even for someone who has just began to learn the language.
Profile Image for Athanasios.
9 reviews
January 21, 2016
Not only a great book on Groovy (the definitive guide out there) but also a nice book on programming in general! Highly recommended!
161 reviews
February 26, 2018
A thick book that takes you deep into Groovy, demonstrating all its power. Those moving from Java to Groovy can probably stop a few chapters in, and then pick it back up once they want more.
Profile Image for Jacob.
118 reviews25 followers
March 2, 2009
I'm beginning to hate Java less, thanks to Groovy.
Profile Image for Oscar.
33 reviews2 followers
March 19, 2015
Mi relación con Groovy va del odio al amor y viceversa.
Displaying 1 - 23 of 23 reviews

Can't find what you're looking for?

Get help and learn more about the design.