Groovy for Domain-Specific Languages

More Information

Learn Groovy scripting designed to get Java programmers using Groovy quicklyUse the meta-programming features in Groovy to build your own DSLsLearn everything you need to know about Groovy markup and build your own Groovy builders to simplify your application developmentBuild effective DSLs using operator overloading and Groovy categoriesWork with Groovy closures Get to grips with the working of Groovy on the JVM and integrate Groovy with your Java applications


You may already be aware that the Java virtual machine runs on everything from the largest mainframe to the smallest microchip and supports almost every conceivable application. What you may not realize is that to develop software in some of these scenarios requires a targeted, single purpose language, a Domain Specific Language. The popular scripting language Groovy can be used to create a Domain Specific Language that can run directly on the JVM alongside regular Java code.This comprehensive tutorial will take you through the design and development of Groovy-based Domain Specific Languages. It is a complete guide to the development of several mini-DSLs with a lot of easy-to-understand examples. This book will help you to gain all of the skills needed to develop your own Groovy-based DSLs, as it guides you from the basics through to the more complex meta-programming features of Groovy. The focus is on how the Groovy language can be used to construct domain-specific mini-languages. Practical examples are used throughout to de-mystify the seemingly complex language features and to show how they can be used to create simple and elegant DSLs. The examples include a quick and simple Groovy DSL to interface with Twitter.The book concludes with a chapter focusing on integrating Groovy-based DSLs in such a way that the scripts can be readily incorporated into the readers' own Java applications. The overall goal of this book is to take Java developers through the skills and knowledge they need to start building effective Groovy-based DSLs to integrate into their own applications.


Build your own Domain Specific Languages on top of GroovyIntegrate your existing Java applications using Groovy-based Domain Specific Languages (DSLs)Develop a Groovy scripting interface to TwitterA step-by-step guide to building Groovy-based Domain Specific Languages that run seamlessly in the Java environment

Page Count 312
Course Length 9 hours 21 minutes
ISBN 9781847196903
Date Of Publication 31 May 2010


Fergal Dearle

Fergal Dearle is a seasoned software development professional with almost 30 years' experience in software product development across a wide variety of technologies. He is currently the principal consultant with his own software development consulting company, Dearle Technologies Ltd., engaged in design, development, and architecture of new software products for client companies. Recent projects have included the integration of the Telegraph ( into Apple's new Apple News application for iOS 9 and the reengineering of the G-Cloud Digital Marketplace for the United Kingdom Cabinet Office (

He is a committed mentor in his local CoderDojo in Wexford Town where he teaches Groovy to the young coding ninjas. He has been recently nominated as a CoderDojo Hero for his work.

In the past, Fergal has worked in lead architect and developer roles for Candle Corporation on the OMEGAMON product, which is now part of IBM's Tivoli product suite, and as the development manager for Unix implementations of Lotus 1-2-3. In the early 1990s, Fergal led the team at Glockenspiel that developed CommonView, the first object-oriented UI framework for Microsoft Windows. The team was awarded one of the first ever Jolt Productivity Awards by Dr. Dobbs Journal.