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

Closures

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

Meta-Programming

  • 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

Grape

  • 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
Facts
NameGroovy
Duration3 Days
LevelBeginner
AudienceJava programmers
PrerequisitesPractical knowledge in Javav programming
Tools
  • Groovy
  • JetBrains Intellij IDEA
  • Java JDK, version 8+
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
CourseDaysLevel
Spock Testing1IntermediateShow
Grails Web Apps5BeginnerShow