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 : English
Paperback : 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
Fergal Dearle
Fergal is a seasoned software development professional with 23 years of experience in software product development across a wide variety of technologies. He is currently principal consultant with his own software development consulting company, Dearle Technologies Ltd., engaged in design, development, and architecture for new software products for client companies. In the past Fergal has worked in lead architect and developer roles for Candle Corporation on the OMEGAMON product which is now part of IBMs Tivoli product suite as development manager for the Unix implementations of Lotus 1-2-3. In the early 1990s Fergal lead 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.
The book has plenty of sample code, which I found well constructed and easy to read, and I believe the book hit it's target. The strengths of using Groovy for Domain Specific Languages are drawn out, and the Groovy language is given a thorough overview. I think this book covered a lot of ground and did it well.
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
- 7 submitted: last submission 21 May 2013
Errata 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.
Errata type: Technical | Page number: 40 | Errata date: 21st April, 2013
The first two lines of the code sample at top of page should be:
customer = new Customer()
customer.setName(“Brian Beausang”)
Note _only_ the first letter "c" must be lower-case!
The following would also work:
Customer customer = new Customer()
Again: note the order of capitalization: uppercase, lowercase, uppercase!
Errata type: Technical | Page number: 19 | Errata date: 21st April, 2013
Before the Closure section, the out for the output for Groovy Version 1.5.8 should be:
["fileUnder":"Software Development", "title":"Groovy for DSL", "author":"Fergal Dearle"]
Groovy for DSL
Groovy for DSL
Errata type: Technical | Page number: 43 | Errata date: 21st April, 2013
The second code example has problem with capitalization; either one of the following two lines will work:
Customer customer = new Customer(name:“Daniel Dewdney”)
customer = new Customer(name:“Daniel Dewdney”)
Errata type: Technical | Page number: 93 | Errata date: 29th April, 2013
Errata type: Technical | Page number: 27 | Errata date: 21st April, 2013
To run a script from a command line, use "$groovy HelloWorld.groovy" instead of "$groovy Hello.groovy".