Summary

We have now built our first fully-fledged, albeit simple, Groovy DSL. We've seen how we can start with an existing Java-based API and evolve it into a simple user-friendly DSL that can be used by almost anybody. We've learned the importance of removing boilerplate code and how we can structure our DSL in such a way that the boilerplate is invisible to our DSL users.

The resulting DSL, being written in Groovy, is still an embedded DSL, but by sufficiently isolating the user scripts from its runtime and boilerplate, we have developed a DSL that could be documented in such a way that non-programming users could readily grasp how to use it. In the next chapter, we will extend our knowledge of the language further, by using some of Groovy's ...

Get Groovy for Domain-specific Languages - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.