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.

Buy Now

Select a DRM-free Format:

In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle or Dropbox, and for a social reading experience we can link the book to your Readmill account. (You'll need to log in to enable these options.)

This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as the authors add material and correct mistakes. You'll get the final eBook when the book is finished.

If you buy the combo pack (Beta eBook + finished Paper Book) now, you'll get the Beta eBook immediately. You'll get the finished paper book when it's released (we're currently estimating 2013-06-10, but these dates can change).

 

About this Book

  • 350 pages (est)
  • Published:
  • Release: B2.0 (2013-03-18)
  • ISBN: 978-1-93778-530-7

The strength of Java is no longer in the language. It’s in the Java Platform—the JVM, JDK, and rich frameworks and libraries. You don’t have to leave the rich Java Platform to take advantage of dynamic languages such as Groovy. Groovy preserves the Java semantics and extends the JDK, so programming in Groovy feels like the Java language has been augmented; it’s like working with a lighter, more elegant Java. If you’re an experienced Java developer who wants to learn how Groovy works, you’ll find exactly what you need in this book.

You’ll start with the fundamentals of programming in Groovy and how it works with Java, and then you’ll explore advanced concepts such as unit testing with mock objects, using Builders, working with databases and XML, and creating DSLs.

This book will help you quickly learn the new features in Groovy 2 so you can readily apply them on your next project. In addition, you’ll master Groovy’s powerful yet complex run-time and compile-time metaprogramming features. Everything’s up to date and waiting for you to dig in!

What You Need

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

Contents and Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

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

About the Author

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.

Upcoming Author Events

  • 2013-01-08: Venkat Subramaniam
    Integrating Groovy and Java (Boulder JUG)
  • 2013-01-09: Venkat Subramaniam
    "Integrating Groovy and Java" and "Design Patterns in Modern JVM Languages" (Denver JUG)
  • 2013-01-15: Venkat Subramaniam
    Scala for the Intrigued (Atlanta JUG)
  • 2013-02-04: Venkat Subramaniam
    Workshops and talks on Functional Programming and JVM related languages. (JFokus - Sweden)
  • 2013-02-18: Venkat Subramaniam
    Talks on Java 8 and also CoffeeScript. (DevNexus - Atlanta)
  • 2013-02-26: Venkat Subramaniam
    Workshop and talks on Agile technical practices. (Agile India - Bangalore)
  • 2013-03-04: Venkat Subramaniam
    An opportunity to hang out with fellow speakers. (SpeakerConf - Aruba)
  • 2013-03-08: Venkat Subramaniam
    Talks on HTML 5 and JVM languages. (NFJS - Minneapolis, MN)
  • 2013-03-13: Venkat Subramaniam
    Various JVM languages related topics. (33degree - Warsaw, Poland)
  • 2013-04-04: Venkat Subramaniam
    JavaScript related topic (DenverJS - Denver, CO)
  • 2013-04-05: Venkat Subramaniam
    Talks on HTML 5 and JVM languages. (NFJS, NYC)
  • 2013-04-21: Venkat Subramaniam
    Talks on HTML 5 and JVM languages. (NFJS, Reston, VA)
  • 2013-04-27: Brian P. Hogan
    JRuby - Imagine mixing the easy syntax, powerful language features, and rapid development of Ruby with the speed, power, and flexibility of the Java Virtual Machine? Ruby and the JVM go together like chocolate and peanut butter, and you'll see some examp (Twin Cities Code Camp, Minneapolis, MN)
  • 2013-05-03: Venkat Subramaniam
    Talks on JVM related languages (NFJS, Charlotte, NC)
  • 2013-05-07: Venkat Subramaniam
    Workshops and talks on various topics (Great Indian Developer Summit, Bangalore)
  • 2013-05-14: Venkat Subramaniam
    Scala for the Intrigued (JUG, San Francisco, CA)
  • 2013-05-17: Venkat Subramaniam
    Various topics related to JVM and HTML5 (NFJS, Dallas, TX)
  • 2013-05-22: Venkat Subramaniam
    Talks on various topics related to Groovy and the JVM. (GR8Conf, Copenhagen)
  • 2013-06-05: Venkat Subramaniam
    Various topics related to Java and architecture (Software Architecture Summit, Berlin)
  • 2013-06-12: Venkat Subramaniam
    Talks on various topics (NDC Oslo)
  • 2013-07-16: Venkat Subramaniam
    Workshops and talks on various topics. (ÜberConf)