13. Omission of get/set methods
class Person {
String name
String email
}
def person = new Person(name: 'me')
person.email = 'email@domain.com'
println person.name// me
println person.email// email@domain.com
14. Initializing beans with named parameters
class Person {
String name
String email
}
def person = new Person(name: 'me')
person.email = 'email@domain.com'
println person.name// me
println person.email// email@domain.com
15. Context operations using with
class Person {
String name
String email
}
def person = new Person(name: 'me',
email: 'email@domain.com')
person.with{
println name// me
println email// email@domain.com
}
16. GStrings (interpolation, multiline)
def param = 'param'
def groovyString = """
There is a ‘${param}’ param
"""
println groovyString// There is a
‘param’ param
17. Native syntax for data structures
def list = [1, 4, 6, 9]
println list[-2] // 6
def map = [UA: 'Ukraine', UK: 'United
Kingdom']
println map.UA // Ukraine
def range = 10..20
println range[2] //12
18. Elvis operator for default values
def name = null
println name != null ? name : "Unknown"
// Unknown
println name ?: "Unknown" // Unknown
name = 'name'
println name ?: "Unknown" // name
25. Easyb - http://easyb.org/
● Behavior driven development framework
● Specifications are written in Groovy and run via a Java runner,
command line, Maven or Ant
● Supports a few different styles of specifications ranging from
RSpec's it to a story based DSL with givens, whens, and thens
26. Grails - http://grails.org/
● Grails is an Open Source, full stack web
application framework for the JVM
● Based on Spring, Hibernate, Sitemesh, Quartz
etc.
● There are a lot of plug-ins
27. Griffon - http://griffon.codehaus.org
● Desktop development framework inspired in Grails
● Primarily Swing based however supports SWT,
Pivot, GTK and JavaFX too
● Growing plugin system (80+ plugins)
29. GPars - http://gpars.codehaus.org/
● Provides DSL and concurrent friendly methods for
collections
● Supports Actors and STM
● Dataflow concurrency model
30. CodeNarc - http://codenarc.sourceforge.net/
● Static analysis for Groovy code
● Over 175 rules to detect defects, bad practices,
style issues etc.
● Build tools and Sonar integration
31. GVM - http://gvmtool.net/
● Manages parallel Versions of multiple SDKs
● Convenient command line interface
● Inspired by RVM
● Supports Groovy, Grails, Gradle etc
● Unfortunately does not work for Win