Groovy introduction
-
Upload
gpottepalem -
Category
Technology
-
view
61 -
download
0
description
Transcript of Groovy introduction
www.cognitomedia.com
Giri PottepalemNov 20, 2013
Groovy – An Introduction
2
What we will cover today…
What is Groovy?
Why Groovy (when we have Java)?
Installation and Integration with Java
Tools
Groovy for Java Eyes
Resources
Hands on, code examples etc.
3
What is Groovy?
Agile and Dynamic Programming language for Java Platform (JVM)
Builds upon the strengths of Java Language
Better, Lighter Java
More readable, less verbose, less noisy than Java
Brings in powerful modern programming features to Java, inspired by languages like Python, Ruby and Smalltalk
Backed by VMware
Taken into core Spring technology stack of latest Spring Eco System (http://spring.io/platform)
4
Why Groovy (when we have Java)?
We are coding in 2013
Many things around us have changed, but not Java
Java evolved as a robust and matured platform, but language is still 1990s and started to show it’s age
Polyglot Programming
Productive language
A flat learning curve for Java Developers
Interoperates with Java seamlessly, compiles to java byte code
Brings the Joy or Programming back to Java
5
Installation and Integration
Installation
http://groovy.codehaus.org/ - Download, unzip
Set env variable GROOVY_HOME
Add %GROOVY_HOME%\bin to PATH
Integration
All you need is just one jar file for Java applications (groovy-all.jar)
6
Tools
groovysh
groovyconsole
IDE plugins (Eclipse, IntelliJ)
7
Groovy for Java Eyes
Optional Java features
Semicolon, parenthesis, obvious scopes, return statement etc.
Enhanced JDK classes
GDK Classes
Native Language support for Collections with consistent syntax like Java arrays
Groovy Beans
Groovy truth
Exception Handling
Classes, Scripts, Constructors etc
Operator overloading
Convenient operators (?. , *. , ?: , << etc. )
Annotations (@Log4j, @ToString etc.)
8
Resources
….and there are even more
Books
http://groovy.codehaus.org/ http://groovyblogs.org/
Resources
http://groovy.codehaus.org/ http://groovyblogs.org/
9
Let’s get some hands on