Groovy

CloudLabs

Projects

Assignment

24x7 Support

Lifetime Access

.

Course Overview

Groovy is a dynamic scripting and programming language for the Java platform. It combines the dynamic features of modern scripting languages such as Ruby and Python with familiar Java syntax. To quote one of the Groovy developers: Groovy is what Java would have been if it had been created in the 21st century. This course introduces the Java developer to the Groovy language.vGroovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of Python, Ruby, Perl, and Smalltalk. It can be used as a scripting language for the Java Platform, is dynamically compiled to Java Virtual Machine (JVM) bytecode, and interoperates with other Java code and libraries. Groovy uses a Java-like curly-bracket syntax. Most Java code is also syntactically valid Groovy.

At the end of the training, participants will be able to:

Pre-requisite

All attendees should have basic knowledge of java.

Duarion

5 days

Course Outline

  • What is Groovy?
  • What Groovy can do
  • Java programmers
  • Script programmers
  • Agile programming
  • Installing
  • Running Groovy scripts
  • Syntax rules
  • Numbers – Integers, Floats, and Big Decimal
  • Strings
  • Double quoted
  • Single quoted
  • Here documents
  • Slash quoted
  • GStrings
  • Operators
  • Collections
  • Lists
  • Coding a closure
  • The it parameter
  • Passing multiple parameters
  • Naming parameters (the -> operator)
  • Maps
  • Ranges
  • If statements
  • The truth in Groovy
  • Switch statements
  • While loops
  • For loops
  • Exceptions
  • Defining classes
  • File-to-class relationships
  • Member variables
  • Automatic getter/setter generation
  • Default visibility
  • Safe dereferencing with ? operato
  • Optional parameters and default parameters
  • Operator overloading
  • Automatic constructor generation
  • Initializing property values in the constructor
  • The Closure Groovy class
  • Coding a method that expects a closure
  • Calling into the closure
  • Passing parameters
  • Closures
  • Using methods as closures
  • Polymorphic closures
  • Operator overloading
  • Meta programming
  • Discovering a class
  • Discovering fields
  • Discovering methods
  • Method resolution
  • Meta Class
  • Meta Property
  • Meta Method
  • Pointers
  • Method
  • Field
  • Calling methods that do not exist
  • Expand Meta Class
  • Categories
  • Regular Expression syntax
  • The =~ operator
  • The ==~ operator
  • Common methods that use Regular Expressions
  • What are Builders and Slurpers?
  • Node Builder
  • MarkupBuilder
  • AntBuilder
  • Creating custom builders
  • Using the ConfigSlurper
  • Writing a Slurper

Reviews