Book Image

Groovy for Domain-Specific Languages, Second Edition

By : Fergal Dearle
Book Image

Groovy for Domain-Specific Languages, Second Edition

By: Fergal Dearle

Overview of this book

Table of Contents (20 chapters)
Groovy for Domain-specific Languages Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introduction to DSLs and Groovy
Index

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.