Groovy for Domain-Specific Languages
Formats:
save 15%!
save 37%!
Free Shipping!
| Also available on: |
|
- Build your own Domain Specific Languages on top of Groovy
- Integrate your existing Java applications using Groovy-based Domain Specific Languages (DSLs)
- Develop a Groovy scripting interface to Twitter
- A step-by-step guide to building Groovy-based Domain Specific Languages that run seamlessly in the Java environment
Book Details
Language : EnglishPaperback : 312 pages [ 235mm x 191mm ]
Release Date : June 2010
ISBN : 184719690X
ISBN 13 : 9781847196903
Author(s) : Fergal Dearle
Topics and Technologies : All Books, Java, Open Source
Table of Contents
Preface
Chapter 1: Introduction to DSL and Groovy
Chapter 2: Groovy Quick Start
Chapter 3: Groovy Closures
Chapter 4: Example DSL: GeeTwitter
Chapter 5: Power Groovy DSL features
Chapter 6: Existing Groovy DSLs
Chapter 7: Building a Builder
Chapter 8: Implementing a Rules DSL
Chapter 9: Integrating it all
Index
Fergal Dearle
Code Downloads
Download the code and support files for this book.
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Errata
- 3 submitted: last submission 29 Apr 2013Errata type: Technical | Page number: 88 | Errata date: 12 July 11
The code contains the comment:
// Ensure twitter-4j-2.0.3.jar is in classpath
But the correct jar file is:
// Ensure twitter4j-2.0.3.jar is in classpath
Please delete the hyphen.
On page 15, Replace "ComplexNumber& ComplexNumber::operator=(const ComplexNumber& num) { real = num.real; imag = num.imag; return *this; }" with "ComplexNumber& ComplexNumber::operator+(const ComplexNumber& num) { real += num.real; imag += num.imag; return *this; }"
Errata type: Technical | Page number: 93 | Errata date: 29th April, 2013
The methods eachFriend() and eachFollowers() need to declare an additional
argument, twitter. This should be the first argument. This error is fixed in
the sample code. Secondly, the book lists these methods as static, but in the sample code the
methods are not static.
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Learn Groovy scripting designed to get Java programmers using Groovy quickly
- Use the meta-programming features in Groovy to build your own DSLs
- Learn everything you need to know about Groovy markup and build your own Groovy builders to simplify your application development
- Build effective DSLs using operator overloading and Groovy categories
- Work 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.
This practical guide will teach you how to build Domain Specific Languages in Groovy that integrate seamlessly with your Java applications
This book is a practical tutorial, walking the reader through examples of building DSLs with Groovy covering meta-programming with Groovy. Some complex concepts are covered in the book but we go through these in a clear and methodically way so that readers will gain a good working knowledge of the techniques involved.
This book is for Java software developers who have an interest in building domain scripting into their Java applications. No knowledge of Groovy is required, although it will be helpful. The book does not teach Groovy, but quickly introduces the basic ideas of Groovy. An experienced Java developer should have no problems with these and move quickly on to the more involved aspects of creating DSLs with Groovy. No experience of creating a DSL is required.
The book should also be useful for experienced Groovy developers who have so far only used Groovy DSLs such as Groovy builders and would like to start building their own Groovy-based DSLs.

