small medium large xlarge

Programming Groovy 2: Dynamic Productivity for the Java Developer


Cover image for Programming Groovy 2

Programming Groovy 2

Dynamic Productivity for the Java Developer


Groovy brings you the best of both worlds: a flexible, highly productive, agile, dynamic language that runs on the rich framework of the Java Platform. Groovy preserves the Java semantics and extends the JDK to give you true dynamic language capabilities. Programming Groovy 2 will help you, the experienced Java developer, learn and take advantage of the latest version of this rich dynamic language. You’ll go from the basics of Groovy to the latest advances in the language, including options for type checking, tail-call and memoization optimizations, compile time metaprogramming, and fluent interfaces to create DSLs.

Customer Reviews

If you ever wondered why dynamic languages in general, and Groovy in particular,
are so popular and how you can leverage them in your own work, this is the book
for you.

- Joe McTee

Developer, JEKLsoft

Whether you’re a Java developer starting to dabble with Groovy, an intermediate
Groovy developer looking to improve your understanding of the language, or an
experienced Groovy developer looking for an introduction to the latest features in
Groovy 2, this book is the perfect way to take your skills to the next level.

- Peter Bell

, hackNY

In this update for Groovy 2, Venkat has done a great job showing you both the
theory and the practice of using Groovy. From basic, everyday tasks to advanced
usage like compile-time metaprogramming and AST transforms, method interception
and synthesis, and creating DSLs, you’ll find a ton packed into this relatively
thin book. Best, it won’t become a desk anchor since you’ll constantly refer to its
many great examples!

- Scott Leberknight

Co-founder and senior software architect, Near Infinity Corp.

I’m delighted that Venkat has revised this essential Groovy tutorial to reflect the
developments in the language and ecosystem since the first edition. Everyone
learning Groovy should have this book in the library.

- Tim Berglund

GitHub trainer and evangelist

Many other programming books assume too much. What makes Venkat’s books
unique is that they welcome various levels of readers without insulting their intelligence.
Programming Groovy 2 is no exception—it is crafted with small palatable
examples that guide the reader in a natural and incremental learning experience
from novice to expert.

- Daniel Hinojosa

Consultant, programmer, speaker, author of "Testing in Scala"

See All Reviews

Choose Your Format(s)

  • $22.00 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

To work on the examples in the book you need Groovy 2.0.5 and Java JDK 5 or higher.

Contents & Extracts

Full Table of Contents

  1. Introduction
  2. Getting Started
  3. Groovy for Java Eyes excerpt
  4. Dynamic Typing
  5. Using Closures excerpt
  6. Working with Strings
  7. Working with Collections
  8. Exploring the GDK
  9. Working with XML
  10. Working with Databases
  11. Working with Scripts and Classes
  12. Exploring Meta-Object Protocol (MOP) excerpt
  13. Intercepting Methods Using MOP
  14. MOP Method Injection
  15. MOP Method Synthesis
  16. MOPping Up
  17. Applying Compile Time Metaprogramming
  18. Groovy Builders
  19. Unit Testing and Mocking
  20. Creating DSLs in Groovy


Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and an adjunct faculty at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly invited speaker at several international conferences. He’s (co)author of multiple books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer.