Adventures in Groovy

500px-Groovy-logo.svgLately my colleague Udo has been busy adding Groovy support to Z2. For those who are not aware, Groovy is a scripting language that is deeply rooted in the Java platform. While Groovy differs in Syntax, Groovy classes interoperate seamlessly with Java classes.

The cool aspect of integrating Groovy, apart from Groovy itself, is that the integration is extremely smooth and required no adaptation of Z2 as such. It’s all just yet another compiler. Using the ability to use Groovy code or any mix of Groovy code with Java code just means add the Groovy Add-On  to your system and to add the declaration

java.compile.order = groovy

to a Java component declaration. That’s it.

We prepared a little sample that highlights just a few capabilities such as

  • Mixing Java and Groovy
  • Using Groovlets and GSPs
  • Using the Groovy-based Spock test specification framework

Check it out at Groovy in Z2 sample.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s