Chapter 19Creating DSLs in Groovy
Domain-specific languages (DSLs) are “targeted at a particular type of problem.”—see the reference to Martin Fowler’s discussions on DSLs in Appendix 1, Web Resources. Their syntax is focused on the intended domain or problem. We don’t use them for general-purpose programming like we use Java, Groovy, or C++, because DSLs have a very limited scope and capability.
A DSL is small, simple (it may not be simple to design, though), expressive, and focused on a problem area or domain. DSLs have two characteristics: they’re context-driven and fluent.
DSLs have been around for a long time. Chances are we’ve worked with them in applications with special keyword input files used to communicate with external applications. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access