concept Groovy dsl in category dsl

This is an excerpt from Manning's book DSLs in Action.
The example uses string concatenation to build the final script that gets executed. One disadvantage of this approach is that if there are any errors in execution, the line numbers in the stack trace won’t match the line numbers in the source file order.dsl. As I’ve mentioned, building a DSL and integrating it with your application is an iterative process. We’ll improve on this strategy in chapter 3 when we discuss yet another method of integrating a Groovy DSL into your application.
Up to this point, you’ve been loading the DSL implementation (ClientOrder.groovy) and the user-defined script (order.dsl) as a single Groovy script that’s executed in the sandbox of the ScriptEngine. The Groovy DSL is completely opaque to the Java code; the script is loaded using a different classloader than your Java classes, which makes them invisible in your main application. You need to buy some time from your client to try to implement alternate ways to integrate the DSL that make Groovy classes more visible to your Java application.