Groovy for Java Developers
description
Transcript of Groovy for Java Developers
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Groovy for Java developersPeter Ledbrook
w: http://www.cacoethes.co.uk/ e: [email protected] t: @pledbrook
To answer the question…
2
3
Why would you use a language called Groovy?
Background
4
OO language for the JVM
Java-like syntax
Optional types
Dynamic or Static - your choice!
Simple & expressive
What is Groovy?
5
Groovy Source
Java Byte Code
JVM
Compilation
java -cp groovy-all-2.3.0.jar …
Groovy is compiled
6
Groovy Source
Java Byte Code
JVM
Compilation
java -cp groovy-all-2.3.0.jar …
Groovy is compiled
7
Just add Groovy JAR to your classpath
How do you use it?
9
Download Groovy development kit (GDK)
Install
groovy, groovyConsole, groovysh
http://groovy.codehaus.org/Download
How do you use it?
10
Install msysgit
Install GVM
gvm install groovy 2.2.2
http://gvmtool.net/
(Windows only)
Run as Administrator
How do you use it?
11
Demo
12
In summary
• Great for cross-platform scripting
• Ideal for tests
• Seamless integration with Java
• Solid for application development
13
A great ecosystem!
14
Geb
SpockGVM
Ratpack
Groovy on Android
15
+
=
http://melix.github.io/blog/2014/06/grooid.html
More info
• Docs: http://groovy-lang.org/docs/groovy-2.3.3/html/
documentation/
• Groovy JDK: http://groovy-lang.org/docs/groovy-2.3.3/html/
groovy-jdk/
• Groovy Koans: http://groovykoans.org/
16
17
Thank you!