RSS Feed Subscribe to RSS Feed

 

TSS2009: The Amazing Groovy Weight Loss Plan

The Amazing Groovy Weight-loss Plan

Speaker: Scott Davis, Editor in Chief, about Groovy.com; Author, Groovy Recipes: Greasing the Wheels of Java and more.

This talk was probably the most entertaining one I attended at TheServerSideSymposium 2009.

Unfortunately the presentation slides don’t seem to be available yet. My limited notes are below…

Groovy is super set of Java

Groovy/Grails – great suport on NetBeans and IntelliJ

Eclipse support: not so great. But G2One, founded around Groovy, has just been bought out by Spring Source and the hope is that SpringSOurce will now be doing work on the Eclipse Groovy plugin…

Scott then used a HelloWorld example to highlight the infrastructure code (class, main declaration etc) that is needed in Java to just do simple things.

And talked about the necessity of an IDE for developing in Java.

He then contrasted that with Grrovy…

println “Hello World!”

Don’t even need to compile (done in memory), but can explicitly compile if you really want to.

Showed a tool called I haven’t came across before called javap which is used for perusing byte code. He used this to show the the Java and Groovy source code, although quite different, results in similar byte code.

Talked about the interesting concept of Groovy ‘Truth”

0/””/null all equal false

NB null is NullObject (everything is an object in Grrovy)

Showed how getter/setters generated automatically.

and how if you declare a field as final, Groovy will generate the getter only, not setter.

He also showed how in Groovy, syntax ‘fluff’ like brackets and semi colons are optional

However, he also talked about how Groovy’s sweetspot in NOT concurrency.

He then talked about the expandable meta class that all objects in Groovy’ have. Basically, you can add methods or properties to a class from within the code itself.

Overall, a great introduction to Groovy and one that makes me want to get more involved with it…

Leave a Reply