Check out this article on writing domain-specific languages for Groovy
DSLs are a powerful feature of the language and for programming in general. It’s always advisable to give software users a language to interact with the software, rather than just a monolithic program that does very specific tasks.