Modern Groovy DSLs

04 October 2017 - David Clark


Making DSL’s in groovy has changed a lot since Groovy 1.0. Back then it was all about what you could do dynamically: implementing propertyMissing and methodMissing, adding operator overloading, using named parameters, and leaving off semi-colons. All of those are still valid groovy, but Groovy has added a lot of features to make DSL’s safer, faster, and easier to use. These are features like the @DelegatesTo annotation, script base classes, type checking extensions, extension modules, and the old standby, closure delegation.

We’ll also talk about what makes a good DSL and when you want to implement one.


David Clark is co-leader of the HttpBuilder-NG project, a popular HTTP client for Groovy and other JVM languages. He has been developing software since 1999. First on the Microsoft stack until 2003, then transitioning to Java technologies (also in 2003). He became an avid Groovy user with version 1.0 in 2007. He currently works as a Master Software Engineer at Capital One.