Groovy On The JVM

I attended the Groovy = Java Tech + Ruby + Python for the JVM session. This is a simple equation that makes a lot of sense to me, especially since I develop a lot of Groovy scripts at work. This session was a 101 introduction to groovy. Rob Cope of OpenLogic did a great job at describing the dynamic aspect of Groovy, Closures, Groovy Markup builders such as AntBuilder and XmlBuilder, and the the GDK extensions.

For those not familiar to Groovy. Groovy is a object-oriented dynamic language that runs on the JVM. In Groovy, static typing and semicolons are optional. Groovy has a lot of built-in features missing in Java, such as regular expressions. A great feature of groovy is that it compiles to a class file which can be used in a Java application. According to Rob, “your boss can’t tell if you are using Groovy.”

The one feature of Groovy that I was not at all familiar with was the Scriptom. Scriptom gives you access to COM objects, in a fashion that is similar to VBScript developers. Rob shows demoed Scriptom, he opened Microsoft Excel added values, created a chart, saved the chart to the file system, created a JFrame with a button that use the chart as an icon. More amazing is that he did this without restarting or closing or rebuilding anything.

I am seriously thinking of replacing all our VBscript dependencies from our application. We use VBScript to open and print Word and Excel documents. With Groovy and Scriptom I could do this in the JVM.

Technorati Tags: , , , , ,