Submission 631 © ASERT 2007
Agile 2007 - 1
Groovy Tutorial
Dr Paul King
ASERT, Australia
Agile 2007 - 2
Submission 631 © ASERT 2007
Topics
Introduction
• Language Basics
• Closures
• Builders
• Data Access
• Other Features
• Testing with Groovy
• Further Integration
• Grails
• More Information
Agile 2007 - 3
Submission 631 © ASERT 2007
What is Groovy?
• “Groovy is like a super version
of Java. It can leverage Java's
enterprise capabilities but also
has cool productivity features like closures,
DSL support, builders and dynamic typing.”
Groovy = Java – boiler plate code
+ optional dynamic typing
+ closures
+ domain specific languages
+ builders
+ metaprogramming
Agile 2007 - 4
Submission 631 © ASERT 2007
Groovy Goodies Overview
• Fully object oriented
• Closures: reusable
and assignable
pieces of code
• Operators can be
overloaded
• Multimethods
• Literal declaration for
lists (arrays), maps,
ranges and regular
expressions
• GPath: efficient
object navigation
• GroovyBeans
• grep and switch
• Templates, builder,
swing, Ant, markup,
XML, SQL, XML-RPC,
Scriptom, Grails,
tests, Mocks
Agile 2007 - 5
Submission 631 © ASERT 2007
Growing Acceptance
• A slow and steady start but now
gaining in momentum; growing in
maturity & mindshare
Groovy
Recipes
Pragmatic
Bookshelf