Opleiding: Groovy Programming
In the course Groovy Programming participants learn to program in the dynamic scripting language Groovy, which is also considered Java++.Groovy Intro
The course starts with an introduction to the basic features of Groovy and covers dynamic typing and type inference in Groovy. It is discussed how Groovy differs from Java with much less boilerplate code and support for scripting.
Language Syntax and Data Structures
Next the Groovy language syntax with variables, data types, conditionals, operators and loops is covered. Groovy data structures like lists, maps and sets are also treated and also how Groovy uses the Java Collection Framework.
Methods and Closures
Groovy methods, parameters passing and closures are also part of the course program. Groovy closures are anonymous code blocks that, as function objects with the scope in which they are created, are stored to be executed at a later time, with or without additional parameters.
Classes and Traits
And just like Java, Groovy is an object-oriented language and attention is paid to how you use classes, constructors, fields, interfaces and traits in Groovy.
XML and JSON
File I/O is on the program of the course as well and in that context the commonly used data formats XML and JSON are treated and how Groovy deals with them.
Meta Programming
Finally the course concludes with a discussion of meta programming in Groovy, which makes it possible to call methods dynamically and to create classes and methods on the fly.
Audience Course Groovy Programming
The course Groovy Programming is intended for Java developers who want to learn programming using the scripting language Groovy.
Prerequisites Course Groovy Programming
To participate in this course knowledge of and experience with programming in Java is required.
Realization Training Groovy Programming
The theory is discussed on the basis of presentation slides and is interspersed with exercises. Illustrative demos provide further clarification of the discussed concepts. The course material is in English.
Certification Groovy Programming
Participants receive an official certificate Groovy Programming after successful completion of the course.
Modules
Module 1 : Groovy Intro
- What is Groovy?
- Groovy Features
- HelloWorld in Java
- HelloWorld in Groovy
- Removing Noise
- Removing Boilerplate
- Dynamic Types
- Variable Interpolation
- POJOs on Steroids
- Script Support
- Differences with Java
- Running Groovy Scripts
- Groovy Development Kit
Module 2 : Language Syntax
- Groovy Variables and Data Types
- Wrapper Types
- Number Methods
- Groovy Strings
- Groovy Conditionals
- Switch Statement
- Groovy Operators
- Other Operators
- Elvis Operator
- Range Operator
- Groovy Loops
- For in Loop
- Each Loop
Module 3 : Data Structures
- Groovy Lists
- List Methods
- List Manipulation
- Groovy Maps
- Map Methods
- Map Manipulation
- Java Collection Interface
- Concrete Collections
- List Interface
- ArrayList Class
- LinkedList Class
- Set and SortedSet
- Map Interface
Module 4 : Methods and Closures
- Groovy Methods
- Method Parameters
- Return Values
- Locals versus Globals
- What are Closures?
- Benefits of Closures
- Groovy Closures
- Closure Parameters
- Closure Variables
- Closures in Methods
- Closures and Collections
- Find and FindAll
- Any and Every
- Collect
Module 5 : File I/O
- IO Basics
- Java Stream Classes
- Stream Types
- Nested Streams
- Groovy IO
- Reading Files
- Writing Text
- Data Conversion Streams
- DataStreams Java
- DataStreams Groovy
- Copy and Delete
- Directory Methods
- Traversing File Trees
- Executing External Processes
Module 6 : Classes and Traits
- Groovy Classes
- Normal Class
- Duck Typing
- Property Support
- Inner Classes
- Inner Class Usage
- Anonymous Inner Class
- Abstract Classes
- Interfaces
- Constructors
- Fields
- Comparator
- Traits
- Meaning of this
Module 7 : XML and JSON Handling
- XML Processing Options
- DOM Tree
- SAX Callbacks
- XML Support in Groovy
- MarkupBuilder
- JSON Object Representation
- JSON Array Representation
- JSON with Array and Objects
- Groovy Json Classes
- Producing JSON from Map
- Produce JSON From Pogo
- JSON with JSONSlurper
Module 8 : Meta Programming
- Groovy is Dynamic
- Dynamic Methods
- Adding Properties
- Meta Object Protocol
- Invoker Operation
- invokeMethod
- GroovyObject interface
- Groovy Interceptable
- Metaclass
- Intercepting Methods
- Expando
- GPath

