SlideShare a Scribd company logo
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

More Related Content

What's hot

A Brief Overview of Kotlin
A Brief Overview of KotlinA Brief Overview of Kotlin
A Brief Overview of Kotlin
Sevil Güler
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y Gradle
Antonio Mas
 
JSDT 2.0 Eclipse DemoCamp (Walldorf)
JSDT 2.0 Eclipse DemoCamp (Walldorf)JSDT 2.0 Eclipse DemoCamp (Walldorf)
JSDT 2.0 Eclipse DemoCamp (Walldorf)
Ilya Buziuk
 
Go lang
Go langGo lang
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
Go Lang
Go LangGo Lang
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
Giulio De Donato
 
Kshitij
KshitijKshitij

What's hot (8)

A Brief Overview of Kotlin
A Brief Overview of KotlinA Brief Overview of Kotlin
A Brief Overview of Kotlin
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y Gradle
 
JSDT 2.0 Eclipse DemoCamp (Walldorf)
JSDT 2.0 Eclipse DemoCamp (Walldorf)JSDT 2.0 Eclipse DemoCamp (Walldorf)
JSDT 2.0 Eclipse DemoCamp (Walldorf)
 
Go lang
Go langGo lang
Go lang
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Go Lang
Go LangGo Lang
Go Lang
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
 
Kshitij
KshitijKshitij
Kshitij
 

Similar to Groovy introduction

Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
Orest Ivasiv
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
mzgubin
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
mzgubin
 
Jug dynamic languages_in_jvm
Jug dynamic languages_in_jvmJug dynamic languages_in_jvm
Jug dynamic languages_in_jvm
Dmitry Buzdin
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
elliando dias
 
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Iván López Martín
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
business Corporate
 
130700548484460000
130700548484460000130700548484460000
130700548484460000
Tanzeel Ahmad
 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!
Iván López Martín
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
SMNajrulHowlader
 
Java introduction
Java introductionJava introduction
Java introduction
Sagar Verma
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
Vimlesh Sharma
 
Groovy And Grails
Groovy And GrailsGroovy And Grails
Groovy And Grails
William Grosso
 
G W T(2)
G W T(2)G W T(2)
G W T(2)
tomcoh
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
josemachoco
 
CSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.pptCSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.ppt
RashedurRahman18
 
Java Intro
Java IntroJava Intro
Java Intro
Nazmul Hasan Rupok
 
JAVA introduction and basic understanding.pptx
JAVA  introduction and basic understanding.pptxJAVA  introduction and basic understanding.pptx
JAVA introduction and basic understanding.pptx
prstsomnath22
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun Again
Danno Ferrin
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
Devathon
 

Similar to Groovy introduction (20)

Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
Jug dynamic languages_in_jvm
Jug dynamic languages_in_jvmJug dynamic languages_in_jvm
Jug dynamic languages_in_jvm
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
 
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
130700548484460000
130700548484460000130700548484460000
130700548484460000
 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Java introduction
Java introductionJava introduction
Java introduction
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
Groovy And Grails
Groovy And GrailsGroovy And Grails
Groovy And Grails
 
G W T(2)
G W T(2)G W T(2)
G W T(2)
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
CSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.pptCSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.ppt
 
Java Intro
Java IntroJava Intro
Java Intro
 
JAVA introduction and basic understanding.pptx
JAVA  introduction and basic understanding.pptxJAVA  introduction and basic understanding.pptx
JAVA introduction and basic understanding.pptx
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun Again
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 

Groovy introduction

  • 1. Groovy – An Introduction Giri Pottepalem Nov 20, 2013 www.cognitomedia.com
  • 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.)
  • 9. Let’s get some hands on
  • 10. Let’s get some hands on

Editor's Notes

  1. Agility comes from many things in SW development: Tools, Frameworks, Environment. Language needs to be agile as well.
  2. Agility comes from many things in SW development: Tools, Frameworks, Environment. Language needs to be agile as well.