Groovy for Domain-specific Languages - Second Edition

(nextflipdebug2) #1
Chapter 6

[ 137 ]

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 more advanced
features, such as builders, metaprogramming, and command chains.

Free download pdf