We are searching for an include mechanism for groovy scripts to have space for cross-cutting-concerns.
In my example we have, web service endpoints as groovy scripts and want to log to our web service protocol. for that we use our implicit object (getting from our framework) to create the logging statement.
But this is boilerplate code if we code this in every web service endpoint.
We are searching for something like include() in php, that includes other groovy scripts, are there any ideas how to do this?
Since you already mentioned “cross-cutting-concerns” I’d say that you need to intercept your webservice calls AOP style (not an include mechanism).
Grails is completely integrated with Spring framework, so this makes for a good option for exploiting Spring AOP features. Take a look at this chapter from grails official guide: http://grails.org/doc/latest/guide/14.%20Grails%20and%20Spring.html and search for word AOP.
Maybe there is a purely groovy way of doing AOP, but I'd go with grails and spring.