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

Chapter 6. Example DSL – GeeTwitter

Before we dive any deeper into Groovy's more advanced features, let's take some time out to build a simple Groovy DSL, using some of the knowledge that we acquired in the previous chapters. In this chapter, we will use closures to build a simple and useful DSL that allows us to automate simple scripts that interact with Twitter.

We will take a stepwise approach to building our DSL. Starting with some vanilla Java APIs that require Groovy or Java programming skills, we will progressively apply some cool Groovy features to evolve a simple DSL that anybody can use.