Groovy and Grails Training

Groovy-and-Grails-Banner

1. Language Overview

  • What is Groovy?
  • What Groovy can do
  • Java programmers
  • Script programmers
  • Agile programming
  • Installing
  • Running Groovy scripts

2. Basic syntax and Scalar variables

  • Syntax rules
  • Numbers
  • Integers
  • Floats
  • BigDecimal
  • Strings
  • Double quoted
  • Single quoted
  • Here documents
  • Slash quoted
  • GStrings
  • Operators

3. Collections

  • Lists
  • Coding a closure
  • The it parameter
  • Passing multiple parameters
  • Naming parameters (the -> operator)
  • Maps
  • Ranges

4. Flow Control

  • If statements
  • The truth in Groovy
  • Switch statements
  • While loops
  • For loops
  • Exceptions

5. Classes

  • Defining classes
  • File-to-class relationships
  • Member variables
  • Automatic getter/setter generation
  • Default visibility
  • Safe dereferencing with ? operator
  • Methods
  • 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

6. Advanced Classes and Closures

  • Closures
  • Using methods as closures
  • Polymorphic closures
  • Operator overloading
  • Metaprogramming
  • Discovering a class
  • Discovering fields
  • Discovering methods
  • Method resolution
  • MetaClass
  • MetaProperty
  • MetaMethod
  • Pointers
  • Method
  • Field
  • Calling methods that do not exist
  • ExpandoMetaClass
  • Categories

7. Regular Expressions

  • Regular Expression syntax
  • The =~ operator
  • The ==~ operator
  • Common methods that use Regular Expressions

8. Builders and Slurpers

  • What are Builders and Slurpers?
  • NodeBuilder
  • MarkupBuilder
  • AntBuilder
  • Using the ConfigSlurper

9. Grails Installation and Overview

  • Installing Grails
  • GRAILS_HOME variable
  • Updating PATH
  • Technologies included with Grails
  • Spring
  • Hibernate
  • Site Mesh
  • AJAX libraries
  • Jetty/Tomcat
  • Main components of a Grails application
  • Domain
  • Controller
  • View
  • Configurations

10. Creating a simple Grails application

  • The create-app command
  • Configuring the application
  • Create a Domain
  • Getting started with the Grails scaffolding
  • Generate views and a controller with create-all
  • Create a basic Controller
  • Running the application
  • Unit Tests

11. The Domain

  • Modeling relationships – belongsTo, mapping, and hasMany
  • One-to-one
  • One-to-many
  • Many-to-Many
  • Validators – constraints
  • GORM
  • Using the dynamic finder methods
  • Criteria objects
  • HQL

12. Domain Queries

  • Using the dynamic finder methods
  • Criteria objects
  • HQL

13. Controllers

  • Navigation
  • Returning data to the view
  • Calling a controller method from the view
  • Scopes
  • Request
  • Flash
  • Session
  • Servlet Context
  • Working with redirects
  • Creating and using services
  • Binding properties to domain objects
  • Command objects

14. GSP basics

  • How GSPs work
  • Common GSP tag libraries
  • Custom error messages
  • Rendering and processing forms
  • Writing custom tag libraries
  • Working with layouts