Part 2. Around the Groovy library


Civilization advances by extending the number of important operations which we can perform without thinking of them.

Alfred North Whitehead

Part 1 has lifted you to the level where you can confidently work with the Groovy language. You’ve also seen a glimpse of some of the fundamental parts of the Groovy library. Part 2 builds upon this knowledge, diving into other pieces of the Groovy library and exploring how Groovy extends the Java Runtime Environment. You’ve already seen how Groovy tries to make commonly performed tasks as easy as possible in the language—this part of the book 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 11 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. We’ll examine the builders that come as part of the Groovy distribution and show you how to implement your own builders.

Chapter 12 covers, at the object/method level, pure GDK library capabilities that weren’t presented in part 1, because they aren’t directly related to language features.

Chapter 13 goes through Groovy’s library support for dealing with relational and other database systems, providing total flexibility where necessary and significant shortcuts where simple solutions suffice.