We can run Groovy code from Java code in several ways. A very simple and easy way is to use the Eval class. The Eval class has five methods to execute simple Groovy expressions with zero to three arguments. All methods are static and the Groovy expression must be a String.
Rule-engine is software that executes code described in a certain rule format. The idea is to use high-level descriptive language to encode domain knowledge into a system. Rule-engine systems are however much more than the rule programming language. Systems typically have special tooling, such as repositories where the knowledge is managed and updated to runtime systems. Drools is an open-source rule-engine that you can try and use for free
Moreover, he shows how to use Drools to classify poker hands. The example is so compelling that I ought to do Grails guide with it.
Until native lambda support comes to Groovy, @tvinke shows how to write them as Closures.
I always had to write the lambdas as closures, which would work since they can be converted into interfaces or single-abstract method (SAM) types. Most of the lamda expressions are build on a Java 8 functional interface, which is a SAM — and Groovy just does automatic closure coercion for us.
I recently worked in a Github issue which triggered me to record a quickcast about how to replace a many-to-one collection efficiently by using a minimal number of queries or leveraging cascade behavior.