Thursday, December 8, 2011

The Art of Groovy Command Expressions in DSLs

Domain Specific Languages (DSLs) are often littered with the accidental complexity of the host language. Have you ever seen a supposedly “friendly” language expression like “ride(minutes(10)).on(bus).towards(Basel)”. The newest version of Groovy contains a language feature that aims to eliminate the noise of all those extra periods and parenthesis, so that your DSL looks more like “ride 10.minutes on bus towards Basel”. This article shows you step-by-step how to use Groovy Command Expressions and plain old metaprogramming to write just this DSL, and also offers advice on when, and when not, to use this new language feature.

The full article is available over on the Canoo Blog:

And of course you can upvote in all the usual places.

Until next time...


greg said...

Damn you Hamlet ! Just yesterday I was desperately searching for a decent article of this nature. Now you went ahead and WROTE IT ? Are you reading my mind ? Are you following me ?

Hamlet D'Arcy said...

Actually... you might be following me. The article originally appeared in No Fluff Just Stuff magazine about 4 months ago. But now the copyright is MINE ALL MINE.

shyn hye park said...

very interesting article, my information is concerned.
Loola 2

hhctnhim said...

Another interesting information and great. I will share with my friends the same reference. Really thank you sharing this, hope the new share more and more from you. Really thank you.
Z6 | Frozen games | Gazo

Dagdgsd Dffbd said...

The article posted was very informative and useful
thanks for sharing..
jaring futsal | jaring golf | jaring kassa / jaring polynet | jaring pengaman proyek | jaring pengaman bangunan | jaring pengaman gedung | jaring gawang | jaring paranet / jaring tanaman | rumput sintetis / rumput futsal |
tangga darurat | jaring cargo | agen jaring | jaring outbound | jaring truk | tali tambang