SlideShare une entreprise Scribd logo
1  sur  76
[object Object]
Canoo Engineering AG
@HamletDRC
A Very Groovy Birthday ,[object Object]
Hamlet D'Arcy
Canoo Engineering AG
@HamletDRC
A Very Groovy Birthday ,[object Object]
Hamlet D'Arcy
Canoo Engineering AG
@HamletDRC
2003 ,[object Object]
2003 ,[object Object]
2003 Closure ,[object Object]
“Refactored CompositeString  to be called ______ :)”
2003 Closure GString ,[object Object]
2003 Range Closure GString ,[object Object]
2003 Range MarkupBuilder Closure GString ,[object Object]
new  groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id:  "child $it " ) } }
new  groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id:  &quot;child $it &quot; ) } } <root> <child id='child1' /> <child id='child2' /> <child id='child3' /> </root>
2004 2003 Range MarkupBuilder Closure GString ,[object Object]
2004 2003 JSR-241 Range MarkupBuilder Closure GString ,[object Object]
2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
def  text =  '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def  vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ]  def  engine = new groovy.text.SimpleTemplateEngine()  engine.createTemplate(text).make(vars)
def  text =  '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def  vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ]  def  engine = new groovy.text.SimpleTemplateEngine()  engine.createTemplate(text).make(vars)  Dear JUG, So nice to meet you in Geneva. Sincerely, Hamlet
2005 2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
2006 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object]
2006 2005 2004 2003 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],0.1-0.3
2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.1-0.3
String. class .metaClass.default = { self ->  self ?:  '<unknown>' } '' .default()
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0, 1.5 0.4-0.7 0.1-0.3
@Grab( group= 'org.ccil.cowan.tagsoup' ,  module= 'tagsoup' ,  version= '1.2' ) import  org.ccil.cowan.tagsoup.Parser def  parser = new XmlParser(new Parser()) def  url =  'http://twitter.com/hamletdrc' def  html = parser.parse(url)
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
def  (x, y) = [ 1 ,  2 ] @Singleton, @Lazy, @Immutable, @Delegate,  ... and more
def  (x, y) = [ 1 ,  2 ] assert  x == 1 assert  y == 2
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.3 0.9 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
Command Chains stand 7.minutes at busstop ride 10.stops on bus towards Basel
JSON Builder import  groovy.json.* def  json =  new  JsonBuilder() json.person { name  'William Tell' status  'mythological' }
AST Transformations @ToString, @EqualsAndHashCode @TupleConstructor, @Canonical @Log, @Field, @Package, ... and many more
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 2.0 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString ,[object Object],1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
@groovy.transform.TypeChecked void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
@groovy.transform.TypeChecked void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } } 1 compilation error: [Static type checking] - Cannot find matching  method java.lang.String#toUppercase() at line: 4, column: 43
void  method(Object message) { if  (message  instanceof  String) { log.info( &quot;Received input: &quot;  + message.toUpperCase() ); } }
@groovy.transform.TypeChecked void  method(Object message) { if  (message  instanceof  String) { log.info( &quot;Received input: ${ message.toUpperCase() }&quot; ) } }
def   keys =  [x: 1 ,y: 2 ,z: 3 ] *.key def   values =  [x: '1' ,y: '2' ,z: '3' ] *.value keys*.toUpperCase() values*.toUpperCase()
Dimension d1 = [ 100 ]  Dimension d2 = [ '100' , '200' ]  Dimension d3 =  new   Dimension(   width:  100 ,    height:  100 ,    depth:  100 )
@groovy.transform.TypeChecked –  Not a static compiler –  No new syntax  –  No new semantics –  Bytecode not changed –  Targeted at Java developers

Contenu connexe

Tendances

concurrency gpars
concurrency gparsconcurrency gpars
concurrency gpars
Paul King
 
Bdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infiniteBdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infinite
Giordano Scalzo
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Paul King
 

Tendances (20)

concurrency gpars
concurrency gparsconcurrency gpars
concurrency gpars
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
Down to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap DumpsDown to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap Dumps
 
Redis 101
Redis 101Redis 101
Redis 101
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueing
 
Groovy
GroovyGroovy
Groovy
 
Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
 
CRUFT! - Peter Kriens, President, aQute
CRUFT! - Peter Kriens, President, aQuteCRUFT! - Peter Kriens, President, aQute
CRUFT! - Peter Kriens, President, aQute
 
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
 
Rop and it's friends
Rop and it's friendsRop and it's friends
Rop and it's friends
 
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development
 
Pwning in c++ (basic)
Pwning in c++ (basic)Pwning in c++ (basic)
Pwning in c++ (basic)
 
Kubernetes Tutorial
Kubernetes TutorialKubernetes Tutorial
Kubernetes Tutorial
 
Bdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infiniteBdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infinite
 
iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
 
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
 
Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)
 
Project in programming
Project in programmingProject in programming
Project in programming
 
Common scenarios in vcl
Common scenarios in vclCommon scenarios in vcl
Common scenarios in vcl
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
 

En vedette

Презентация Программы лингвистического обеспечения города Сочи
Презентация Программы лингвистического обеспечения города СочиПрезентация Программы лингвистического обеспечения города Сочи
Презентация Программы лингвистического обеспечения города Сочи
ABBYY Language Serivces
 
Translation Automation Going Cloud: The New Landscape for Professional Transl...
Translation Automation Going Cloud: The New Landscape for Professional Transl...Translation Automation Going Cloud: The New Landscape for Professional Transl...
Translation Automation Going Cloud: The New Landscape for Professional Transl...
ABBYY Language Serivces
 
33rd degree conference
33rd degree conference33rd degree conference
33rd degree conference
pcmanus
 
The Elements of Service-Learning
The Elements of Service-LearningThe Elements of Service-Learning
The Elements of Service-Learning
Chelsea Montrois
 
Trabalhos finais oa12 ut6 2010 2011
Trabalhos finais oa12 ut6 2010 2011Trabalhos finais oa12 ut6 2010 2011
Trabalhos finais oa12 ut6 2010 2011
amarques_1
 
Competency Statements
Competency StatementsCompetency Statements
Competency Statements
Jessica Thyer
 
Holistic Health Examination Dr Shriniwas Kashalikar
Holistic Health Examination Dr Shriniwas KashalikarHolistic Health Examination Dr Shriniwas Kashalikar
Holistic Health Examination Dr Shriniwas Kashalikar
ppkalghatgi
 

En vedette (20)

Static Analysis and AST Transformations
Static Analysis and AST TransformationsStatic Analysis and AST Transformations
Static Analysis and AST Transformations
 
Презентация Программы лингвистического обеспечения города Сочи
Презентация Программы лингвистического обеспечения города СочиПрезентация Программы лингвистического обеспечения города Сочи
Презентация Программы лингвистического обеспечения города Сочи
 
New Ideas for Old Code - Greach
New Ideas for Old Code - GreachNew Ideas for Old Code - Greach
New Ideas for Old Code - Greach
 
Is MT ready for e-Government? The Latvian Story. Indra Samite, Tilde
Is MT ready for e-Government? The Latvian Story. Indra Samite, TildeIs MT ready for e-Government? The Latvian Story. Indra Samite, Tilde
Is MT ready for e-Government? The Latvian Story. Indra Samite, Tilde
 
Translation Automation Going Cloud: The New Landscape for Professional Transl...
Translation Automation Going Cloud: The New Landscape for Professional Transl...Translation Automation Going Cloud: The New Landscape for Professional Transl...
Translation Automation Going Cloud: The New Landscape for Professional Transl...
 
Static Analysis in IDEA
Static Analysis in IDEAStatic Analysis in IDEA
Static Analysis in IDEA
 
33rd degree conference
33rd degree conference33rd degree conference
33rd degree conference
 
Vamos ubuntar
Vamos ubuntarVamos ubuntar
Vamos ubuntar
 
ELIA - Together: The growth from freelancer to translation company - Anja Jones
ELIA - Together: The growth from freelancer to translation company - Anja JonesELIA - Together: The growth from freelancer to translation company - Anja Jones
ELIA - Together: The growth from freelancer to translation company - Anja Jones
 
Aquaprofit - Chinese
Aquaprofit - ChineseAquaprofit - Chinese
Aquaprofit - Chinese
 
example 4
example 4example 4
example 4
 
The Elements of Service-Learning
The Elements of Service-LearningThe Elements of Service-Learning
The Elements of Service-Learning
 
Periodismo político (1)
Periodismo político (1)Periodismo político (1)
Periodismo político (1)
 
Trabalhos finais oa12 ut6 2010 2011
Trabalhos finais oa12 ut6 2010 2011Trabalhos finais oa12 ut6 2010 2011
Trabalhos finais oa12 ut6 2010 2011
 
example 5
example 5example 5
example 5
 
Competency Statements
Competency StatementsCompetency Statements
Competency Statements
 
Castelao
CastelaoCastelao
Castelao
 
Holistic Health Examination Dr Shriniwas Kashalikar
Holistic Health Examination Dr Shriniwas KashalikarHolistic Health Examination Dr Shriniwas Kashalikar
Holistic Health Examination Dr Shriniwas Kashalikar
 
Task
TaskTask
Task
 
JTTRANS
JTTRANSJTTRANS
JTTRANS
 

Similaire à 10 Years of Groovy

JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Guillaume Laforge
 
marko_go_in_badoo
marko_go_in_badoomarko_go_in_badoo
marko_go_in_badoo
Marko Kevac
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
Marian Marinov
 

Similaire à 10 Years of Groovy (20)

Faceted Search – the 120 Million Documents Story
Faceted Search – the 120 Million Documents StoryFaceted Search – the 120 Million Documents Story
Faceted Search – the 120 Million Documents Story
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Macros in system programing
Macros in system programingMacros in system programing
Macros in system programing
 
Oracle on AWS RDS Migration - 성기명
Oracle on AWS RDS Migration - 성기명Oracle on AWS RDS Migration - 성기명
Oracle on AWS RDS Migration - 성기명
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
Sql Saturday Spatial Data Ss2008 Michael Stark   CopySql Saturday Spatial Data Ss2008 Michael Stark   Copy
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
marko_go_in_badoo
marko_go_in_badoomarko_go_in_badoo
marko_go_in_badoo
 
Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)
 
The Ring programming language version 1.8 book - Part 51 of 202
The Ring programming language version 1.8 book - Part 51 of 202The Ring programming language version 1.8 book - Part 51 of 202
The Ring programming language version 1.8 book - Part 51 of 202
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
 
Storing 16 Bytes at Scale
Storing 16 Bytes at ScaleStoring 16 Bytes at Scale
Storing 16 Bytes at Scale
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
Postgres vs Elasticsearch while enriching data - Vlad Somov | Ruby Meditaiton...
Postgres vs Elasticsearch while enriching data - Vlad Somov | Ruby Meditaiton...Postgres vs Elasticsearch while enriching data - Vlad Somov | Ruby Meditaiton...
Postgres vs Elasticsearch while enriching data - Vlad Somov | Ruby Meditaiton...
 
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
 

Plus de HamletDRC (6)

AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
Java Boilerplate Busters
Java Boilerplate BustersJava Boilerplate Busters
Java Boilerplate Busters
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
 
Java Boilerplate Busters
Java Boilerplate BustersJava Boilerplate Busters
Java Boilerplate Busters
 
Ast transformations
Ast transformationsAst transformations
Ast transformations
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

10 Years of Groovy

  • 1.
  • 4.
  • 8.
  • 12.
  • 13.
  • 14.
  • 15. “Refactored CompositeString to be called ______ :)”
  • 16.
  • 17.
  • 18.
  • 19. new groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id: &quot;child $it &quot; ) } }
  • 20. new groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id: &quot;child $it &quot; ) } } <root> <child id='child1' /> <child id='child2' /> <child id='child3' /> </root>
  • 21.
  • 22.
  • 23.
  • 24. def text = '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ] def engine = new groovy.text.SimpleTemplateEngine() engine.createTemplate(text).make(vars)
  • 25. def text = '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ] def engine = new groovy.text.SimpleTemplateEngine() engine.createTemplate(text).make(vars) Dear JUG, So nice to meet you in Geneva. Sincerely, Hamlet
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. String. class .metaClass.default = { self -> self ?: '<unknown>' } '' .default()
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. @Grab( group= 'org.ccil.cowan.tagsoup' , module= 'tagsoup' , version= '1.2' ) import org.ccil.cowan.tagsoup.Parser def parser = new XmlParser(new Parser()) def url = 'http://twitter.com/hamletdrc' def html = parser.parse(url)
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. def (x, y) = [ 1 , 2 ] @Singleton, @Lazy, @Immutable, @Delegate, ... and more
  • 51. def (x, y) = [ 1 , 2 ] assert x == 1 assert y == 2
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. Command Chains stand 7.minutes at busstop ride 10.stops on bus towards Basel
  • 63. JSON Builder import groovy.json.* def json = new JsonBuilder() json.person { name 'William Tell' status 'mythological' }
  • 64. AST Transformations @ToString, @EqualsAndHashCode @TupleConstructor, @Canonical @Log, @Field, @Package, ... and many more
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
  • 70. @groovy.transform.TypeChecked void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
  • 71. @groovy.transform.TypeChecked void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } } 1 compilation error: [Static type checking] - Cannot find matching method java.lang.String#toUppercase() at line: 4, column: 43
  • 72. void method(Object message) { if (message instanceof String) { log.info( &quot;Received input: &quot; + message.toUpperCase() ); } }
  • 73. @groovy.transform.TypeChecked void method(Object message) { if (message instanceof String) { log.info( &quot;Received input: ${ message.toUpperCase() }&quot; ) } }
  • 74. def keys = [x: 1 ,y: 2 ,z: 3 ] *.key def values = [x: '1' ,y: '2' ,z: '3' ] *.value keys*.toUpperCase() values*.toUpperCase()
  • 75. Dimension d1 = [ 100 ] Dimension d2 = [ '100' , '200' ] Dimension d3 = new Dimension( width: 100 , height: 100 , depth: 100 )
  • 76. @groovy.transform.TypeChecked – Not a static compiler – No new syntax – No new semantics – Bytecode not changed – Targeted at Java developers
  • 77. def v = 1 v = v.toString() println v.toUpperCase()
  • 78. Flow Sensitive Typing def v = 1 v = v.toString() println v.toUpperCase()
  • 79. Flow Sensitive Typing def v = 1 v = v.toString() println v.toUpperCase() – Under discussion
  • 80. int fib(int i) { i < 2 ? 1 : fib(i - 2 ) + fib(i - 1 ) }
  • 81. @groovy.transform.CompileStatic int fib(int i) { i < 2 ? 1 : fib(i - 2 ) + fib(i - 1 ) }
  • 82. @groovy.transform.CompileStatic – Is a static compiler – No new syntax – Requires new semantics – Bytecode is changed
  • 83. @groovy.transform.CompileStatic – Is a static compiler – No new syntax – Requires new semantics – Bytecode is changed – InvokeDynamic?
  • 84.