Groovy – An Introduction

Giri Pottepalem
Nov 20, 2013

www.cognitomedia.com
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.
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)
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
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)
Tools
 groovysh
 groovyconsole
 IDE plugins (Eclipse, IntelliJ)
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.)
Resources
 http://groovy.codehaus.org/
 http://groovyblogs.org/

Books

….and there are even more
Let’s get some hands on
Let’s get some hands on

Groovy introduction

  • 1.
    Groovy – AnIntroduction Giri Pottepalem Nov 20, 2013 www.cognitomedia.com
  • 2.
    What we willcover 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 (whenwe 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 JavaEyes  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.
  • 9.
  • 10.

Editor's Notes

  • #3 Agility comes from many things in SW development: Tools, Frameworks, Environment. Language needs to be agile as well.
  • #4 Agility comes from many things in SW development: Tools, Frameworks, Environment. Language needs to be agile as well.