SlideShare une entreprise Scribd logo
1  sur  19
Groovy ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],What is groovy?
Where does it Work? ,[object Object],[object Object],[object Object],[object Object]
dynamic types (sort of) Value Java Type def a = “hello” String def a = 1 Integer def a = 1.5 BigDecimal def a = [1,2,3,4] ArrayList def person =  [name: “Ashish”, age: 27] LinkedHashMap
syntax sugar ,[object Object],[object Object],[object Object],[object Object]
Collections: Lists ,[object Object],[object Object],[object Object]
Collections: Maps ,[object Object],[object Object],[object Object]
closures and blocks ,[object Object],[object Object]
Closures: Why useful? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Closures: Why useful? def newCourses = courses.findAll { course -> course.courseType == 3 }
Closures: Why useful? def newCourses = courses.findAll { it.courseType == 3 }
Reading XML ,[object Object],[object Object],[object Object],[object Object]
Writing XML ,[object Object],[object Object],[object Object]
How we can use Groovy ,[object Object],[object Object],[object Object],[object Object]
Gant: Groovy ANT includeTargets << gant.targets.Clean cleanPattern << [ '**/*~' ,  '**/*.bak' ] cleanDirectory << 'build' target ( stuff : 'A target to  do  some stuff.' ) { println ( 'Stuff' ) depends ( clean ) echo ( message : 'A  default  message from Ant.' ) otherStuff ( ) } target ( otherStuff : 'A target to  do  some other stuff' ) { println ( 'OtherStuff' ) echo ( message : 'Another message from Ant.' ) clean ( ) } setDefaultTarget ( stuff )
GANT: Listing Tasks gant -p clean  Action the cleaning. clobber  Action the clobbering.  Do the cleaning first. otherStuff  A target to  do  some other stuff stuff  A target to  do  some stuff. Default target is stuff.
Seam Integration ,[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Web Flows class BookController { ... def shoppingCartFlow = { showCart { on( &quot;checkout&quot; ).to  &quot;enterPersonalDetails&quot; on( &quot;continueShopping&quot; ).to  &quot;displayCatalogue&quot; } ... displayCatalogue { redirect(controller: &quot;catalogue&quot; , action: &quot;show&quot; ) } displayInvoice() } }
Questions ,[object Object]

Contenu connexe

Tendances

GR8Conf 2011: GPars
GR8Conf 2011: GParsGR8Conf 2011: GPars
GR8Conf 2011: GParsGR8Conf
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) MicrosoftJimmy Schementi
 
What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift AwesomeSokna Ly
 
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, GettLean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, GettDroidConTLV
 
The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180Mahmoud Samir Fayed
 
Javascript development done right
Javascript development done rightJavascript development done right
Javascript development done rightPawel Szulc
 
Kotlin : Happy Development
Kotlin : Happy DevelopmentKotlin : Happy Development
Kotlin : Happy DevelopmentMd Sazzad Islam
 
Ruby on rails - Ruby Basics
Ruby on rails - Ruby BasicsRuby on rails - Ruby Basics
Ruby on rails - Ruby BasicsEmad Elsaid
 
No excuses, switch to kotlin
No excuses, switch to kotlinNo excuses, switch to kotlin
No excuses, switch to kotlinThijs Suijten
 
Ganga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridGanga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridMatt Williams
 
"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy"Simple Made Easy" Made Easy
"Simple Made Easy" Made EasyKent Ohashi
 
Mito, a successor of Integral
Mito, a successor of IntegralMito, a successor of Integral
Mito, a successor of Integralfukamachi
 
Android dev toolbox - Shem Magnezi, WeWork
Android dev toolbox - Shem Magnezi, WeWorkAndroid dev toolbox - Shem Magnezi, WeWork
Android dev toolbox - Shem Magnezi, WeWorkDroidConTLV
 

Tendances (20)

GR8Conf 2011: GPars
GR8Conf 2011: GParsGR8Conf 2011: GPars
GR8Conf 2011: GPars
 
Latinoware
LatinowareLatinoware
Latinoware
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
 
What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift Awesome
 
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, GettLean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
 
The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180
 
Javascript development done right
Javascript development done rightJavascript development done right
Javascript development done right
 
Advanced I/O in browser
Advanced I/O in browserAdvanced I/O in browser
Advanced I/O in browser
 
Kotlin : Happy Development
Kotlin : Happy DevelopmentKotlin : Happy Development
Kotlin : Happy Development
 
Beautiful soup
Beautiful soupBeautiful soup
Beautiful soup
 
Ruby on rails - Ruby Basics
Ruby on rails - Ruby BasicsRuby on rails - Ruby Basics
Ruby on rails - Ruby Basics
 
Kotlin
KotlinKotlin
Kotlin
 
Objective c(lang)
Objective c(lang)Objective c(lang)
Objective c(lang)
 
No excuses, switch to kotlin
No excuses, switch to kotlinNo excuses, switch to kotlin
No excuses, switch to kotlin
 
Ganga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridGanga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing grid
 
"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy
 
Mito, a successor of Integral
Mito, a successor of IntegralMito, a successor of Integral
Mito, a successor of Integral
 
working with files
working with filesworking with files
working with files
 
Android dev toolbox - Shem Magnezi, WeWork
Android dev toolbox - Shem Magnezi, WeWorkAndroid dev toolbox - Shem Magnezi, WeWork
Android dev toolbox - Shem Magnezi, WeWork
 

En vedette

T P O T Overview Feb 10 Jd
T P O T  Overview  Feb 10 JdT P O T  Overview  Feb 10 Jd
T P O T Overview Feb 10 JdDigital Supremo
 
Leadership in a modern adult unit
Leadership in a modern adult unitLeadership in a modern adult unit
Leadership in a modern adult unitDigital Supremo
 
Speakeasy onbeingdigital 100810
Speakeasy onbeingdigital 100810Speakeasy onbeingdigital 100810
Speakeasy onbeingdigital 100810Digital Supremo
 
Opdracht Informatica web2.0
Opdracht Informatica web2.0Opdracht Informatica web2.0
Opdracht Informatica web2.0stijngheysen
 
Бэкенд, фронтенд — всё смешалось (nodkz)
Бэкенд, фронтенд — всё смешалось (nodkz)Бэкенд, фронтенд — всё смешалось (nodkz)
Бэкенд, фронтенд — всё смешалось (nodkz)Pavel Chertorogov
 
מצגת ליום העצמאות
מצגת ליום העצמאותמצגת ליום העצמאות
מצגת ליום העצמאותguest623a27
 
an animation sample
an animation samplean animation sample
an animation samplegasx2007
 
Pk thedifference jeremydent_100927
Pk thedifference jeremydent_100927Pk thedifference jeremydent_100927
Pk thedifference jeremydent_100927Digital Supremo
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)Pavel Chertorogov
 
Opdracht Informatica
Opdracht InformaticaOpdracht Informatica
Opdracht Informaticastijngheysen
 
Coffee hour about Sri Lanka
Coffee hour about Sri LankaCoffee hour about Sri Lanka
Coffee hour about Sri Lankaguest7dc6c9
 
Short intro to Purple WiFi and Digital Supremo
Short intro to Purple WiFi and Digital SupremoShort intro to Purple WiFi and Digital Supremo
Short intro to Purple WiFi and Digital SupremoDigital Supremo
 

En vedette (16)

T P O T Overview Feb 10 Jd
T P O T  Overview  Feb 10 JdT P O T  Overview  Feb 10 Jd
T P O T Overview Feb 10 Jd
 
Mobile Technology07202010
Mobile Technology07202010Mobile Technology07202010
Mobile Technology07202010
 
Leadership in a modern adult unit
Leadership in a modern adult unitLeadership in a modern adult unit
Leadership in a modern adult unit
 
Speakeasy onbeingdigital 100810
Speakeasy onbeingdigital 100810Speakeasy onbeingdigital 100810
Speakeasy onbeingdigital 100810
 
Opdracht Informatica web2.0
Opdracht Informatica web2.0Opdracht Informatica web2.0
Opdracht Informatica web2.0
 
Internships and interviews fall2013
Internships and interviews fall2013Internships and interviews fall2013
Internships and interviews fall2013
 
Бэкенд, фронтенд — всё смешалось (nodkz)
Бэкенд, фронтенд — всё смешалось (nodkz)Бэкенд, фронтенд — всё смешалось (nodkz)
Бэкенд, фронтенд — всё смешалось (nodkz)
 
מצגת ליום העצמאות
מצגת ליום העצמאותמצגת ליום העצמאות
מצגת ליום העצמאות
 
an animation sample
an animation samplean animation sample
an animation sample
 
Pk thedifference jeremydent_100927
Pk thedifference jeremydent_100927Pk thedifference jeremydent_100927
Pk thedifference jeremydent_100927
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
 
Opdracht Informatica
Opdracht InformaticaOpdracht Informatica
Opdracht Informatica
 
Coffee hour about Sri Lanka
Coffee hour about Sri LankaCoffee hour about Sri Lanka
Coffee hour about Sri Lanka
 
Short intro to Purple WiFi and Digital Supremo
Short intro to Purple WiFi and Digital SupremoShort intro to Purple WiFi and Digital Supremo
Short intro to Purple WiFi and Digital Supremo
 
PurpleWiFi presentation
PurpleWiFi presentationPurpleWiFi presentation
PurpleWiFi presentation
 
Maestria
MaestriaMaestria
Maestria
 

Similaire à Groovy Java Made Painless With Dynamic Language Features

2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005Tugdual Grall
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemKostas Saidis
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In PythonMarwan Osman
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoRodolfo Carvalho
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java DevelopersAndres Almiray
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Robert Stern
 
python beginner talk slide
python beginner talk slidepython beginner talk slide
python beginner talk slidejonycse
 
Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Andres Almiray
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyAndres Almiray
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 

Similaire à Groovy Java Made Painless With Dynamic Language Features (20)

2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
Groovy!
Groovy!Groovy!
Groovy!
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystem
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Groovy
GroovyGroovy
Groovy
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
python beginner talk slide
python beginner talk slidepython beginner talk slide
python beginner talk slide
 
Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To Groovy
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 

Groovy Java Made Painless With Dynamic Language Features

  • 1.
  • 2.
  • 3.
  • 4. dynamic types (sort of) Value Java Type def a = “hello” String def a = 1 Integer def a = 1.5 BigDecimal def a = [1,2,3,4] ArrayList def person = [name: “Ashish”, age: 27] LinkedHashMap
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Closures: Why useful? def newCourses = courses.findAll { course -> course.courseType == 3 }
  • 11. Closures: Why useful? def newCourses = courses.findAll { it.courseType == 3 }
  • 12.
  • 13.
  • 14.
  • 15. Gant: Groovy ANT includeTargets << gant.targets.Clean cleanPattern << [ '**/*~' , '**/*.bak' ] cleanDirectory << 'build' target ( stuff : 'A target to do some stuff.' ) { println ( 'Stuff' ) depends ( clean ) echo ( message : 'A default message from Ant.' ) otherStuff ( ) } target ( otherStuff : 'A target to do some other stuff' ) { println ( 'OtherStuff' ) echo ( message : 'Another message from Ant.' ) clean ( ) } setDefaultTarget ( stuff )
  • 16. GANT: Listing Tasks gant -p clean Action the cleaning. clobber Action the clobbering. Do the cleaning first. otherStuff A target to do some other stuff stuff A target to do some stuff. Default target is stuff.
  • 17.
  • 18. Spring Web Flows class BookController { ... def shoppingCartFlow = { showCart { on( &quot;checkout&quot; ).to &quot;enterPersonalDetails&quot; on( &quot;continueShopping&quot; ).to &quot;displayCatalogue&quot; } ... displayCatalogue { redirect(controller: &quot;catalogue&quot; , action: &quot;show&quot; ) } displayInvoice() } }
  • 19.