Course in Groovy

Course in Groovy Programming

Groovy is a natural extension of Java. We insist refering to it as "Java ++". It is very easy to step-wise transform a Java program into Groovy. The interesting take-away from such an exercise is to reveal how much boiler plate code there is within a Java program. It is also easy to embed Groovy functionality within a Java application.
This is what you will learn
  • Apply teh data types and operators of Groovy
  • Apply closures/lambdas
  • Apply meta-programming
  • Apply and utilize Groovy builders
  • Process both XML and JSON
Course Contents

Background and Overview

  • What is a JVM language
  • Why is Groovy so much better than Java
  • Installation of Groovy

Basic Syntax

  • Skip semicolons and stuff
  • Duck typing
  • Groovy strings
  • Groovy beans

Groovy Data-Types

  • Lists
  • Maps
  • Ranges
  • Regexes

Groovy Operators

  • Null-catch operator
  • Elvis operator
  • Spread operator
  • Spaceship operator
  • as operator
  • Operator overloading
  • The versatile switch statement


  • What is a closure
  • Syntax
  • How to deal with free variables
  • Higher order functions
  • Currying


  • Inspection
  • Groovy meta-class
  • How to add new functions to old classes
  • How to implement dynamic methods
  • Use of expandos
  • Use of GPath

Java API made Groovier

  • Overview
  • Iteration methods
  • Text manipulation
  • Dates and times
  • Easy file handling
  • Threads and processes

Groovy Annotations

  • Overview of AST processing
  • ToString
  • EqualsAndHashCode
  • TupleConstructor
  • Canonical
  • Immutable
  • Singleton
  • Sortable


  • How to download and cache 3:rd party libraries
  • Grape annotations
  • Configuration
  • Using the system class-loader
  • The grape command-line tool

Groovy Shell Scripts

  • What is groovy script
  • Making it into a shell script
  • Getting command-line arguments

Embedded Groovy

  • Invoking Groovy from a Java program
  • Java 8 syntax not supported
  • Mixing Java and Groovy in the same call hierarchy
  • Evaluating dynamic Groovy expressions
  • Using the GroovyShell class

Groovy Builders

  • What is a builder and why should I bother
  • ObjectGraph Builder
  • FileTree Builder
  • Swing Builder
  • Ant Builder
  • How to implement your own builder

Processing XML

  • Generating XML
  • Reading/parsing XML

Processing JSON

  • Generating JSON
  • Reading/parsing JSON

Working with Databases

  • Fetching the JDBC driver using Grape
  • Creating a Sql object
  • CRUD DB operations
  • Using an in-memory database

Processing MS Excel

  • Apache POI
  • Generating YaML from Excel

Short about GPars

  • What is GPars
  • Concurrency for a modern world

Short about Gradle

  • What is Gradle
  • Smart build-tool for JVM languages and C/C++

Short about Spock and Geb

  • What is Spock
  • Unit testing done right

Short about Grails

  • What is Grails
  • Build modern web-apps in a jiffy

Groovy Frameworks

  • Griffon
  • Ratpack
  • Jenkins
  • SdkMan
  • GrooScript
Duration3 Days
AudienceJava programmers
PrerequisitesPractical knowledge in Javav programming
  • Groovy
  • JetBrains Intellij IDEA
  • Java JDK, version 8+
Course Dates
DatePlace Price
2020-01-27Stockholm 19 000 kr
2020-02-17Stockholm 19 000 kr
2020-03-09Stockholm 19 000 kr
2020-03-30Stockholm 19 000 kr
2020-04-14Stockholm 19 000 kr
2020-05-25Stockholm 19 000 kr
2020-06-15Stockholm 19 000 kr

Same-Company Discout

We offer a 20% discount for additional participants from the same company and at the same course date. Read more here.

Teaching Language

Our printed course material is always authored in English. The oral presentation in our classrooms is generally in Swedish, unless all participants agree to that we perform the course in English.

On-Site Course

If you order an On-Site course, we will come to you and hold the course in your office. The price is determined by our price model and is based on the number of course days, number of participants and any travel and lodging.

Read more about out price modell and term of sales here.

Related Courses
Spock Testing1IntermediateShow
Grails Web Apps5BeginnerShow