O'Reilly logo

Groovy for Domain-Specific Languages by Fergal Dearle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Power Groovy DSL features

In this chapter, we will cover some more advanced Groovy features. Coincidentally, these are also the features that, along with closures, allow us to extend and manipulate the language in order to create DSLs. We will cover a lot of ground in this chapter, including the following important features:

  • Named parameters

    To begin, we will look at this simple but effective feature, and see how Maps passed as parameters act as named parameters to a method.

  • Builders

    We will cover how to use Groovy builders to rapidly construct anything from web pages and XML to Swing UIs. While looking at Groovy builders, we will also introduce the native Groovy support for tree-based DOM structures, by looking at the built-in GPath operators ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required