SlideShare a Scribd company logo
to Infinity
and Beyond
Guillaume Laforge

   • Groovy Project Manager
   • JSR-241 Spec Lead
   • Head of Groovy Development
     at SpringSource
   • Initiator of the Grails framework

   • Co-author of Groovy in Action

   • Speaker: JavaOne, QCon, JavaZone, Sun TechDays,
     Devoxx, The Spring Experience, SpringOne, JAX,
     Dynamic Language World, IJTC, and more...

Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   2
Agenda

•Past
        – Groovy 1.6 flashback


•Present
        – Groovy 1.7 novelties
        – A few Groovy 1.7.x refinements


•Future
        – What’s cooking for 1.8 and beyond




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   3
looking into the Past
Big highlights of Groovy 1.6

   • Greater compile-time and runtime performance
   • Multiple assignments
   • Optional return for if/else and try/catch/finally
   • Java 5 annotation definition
   • AST Transformations
   • The Grape module and dependency system
   • Various Swing related improvements
   • JMX Builder
   • Metaprogramming additions
   • JSR-223 scripting engine built-in
   • Out-of-the-box OSGi support
Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   5
Multiple assignement

                                     //
multiple
assignment
                                     def
(a,
b)
=
[1,
2]
                                     assert
a
==
1
&&
b
==
2

                                     //
with
typed
variables
                                     def
(int
c,
String
d)
=
[3,
"Hi"]
                                     assert
c
==
3
&&
d
==
"Hi"

                                     def
geocode(String
place)
{
[48.8,
2.3]
}
                                     def
lat,
lng
                                     //
assignment
to
existing
variables
                                     (lat,
lng)
=
geocode('Paris')

                                      //
classical
variable
swaping
example
                                      (a,
b)
=
[b,
a]


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   6
More optional return

                                  //
optional
return
for
if
statements
                                  def
m1()
{
                                  



if
(true)
1
                                  



else
0
                                  }
                                  assert
m1()
==
1

                                   //
optional
return
for
try/catch/finally
                                   def
m2(bool)
{
                                   



try
{
                                   







if
(bool)
throw
new
Exception()
                                   







1
                                   



}
catch
(any)
{
2
}
                                   



finally
{
3
}
                                   }
                                   assert
m2(true)
==
2
&&
m2(false)
==
1


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   7
AST Transformation (1/2)

   • Groovy 1.6 introduced AST Transformations
   • AST: Abstract Syntax Tree
   • Ability to change what’s being compiled by the
     Groovy compiler... at compile time
           – No runtime impact!
           – Change the semantics of your programs! Even hijack the
             Groovy syntax!
           – Implementing recurring patterns in your code base
           – Remove boiler-plate code
   • Two kinds: global and local (triggered by anno)



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   8
AST Transformations (2/2)

   • Transformations introduced in 1.6
           – @Singleton
           – @Immutable, @Lazy, @Delegate
           – @Newify
           – @Category, @Mixin
           – @PackageScope
           – Swing’s @Bindable and @Vetoable
           – Grape’s own @Grab




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   9
@Immutable

   • To properly implement immutable classes
           – No mutations — state musn’t change
           – Private final fields
           – Defensive copying of mutable components
           – Proper equals() / hashCode() / toString()
             for comparisons or fas keys in maps


                                       @Immutable
class
Coordinates
{
                                       



Double
lat,
lng
                                       }
                                       def
c1
=
new
Coordinates(lat:
48.8,
lng:
2.5)
                                       def
c2
=
new
Coordinates(48.8,
2.5)
                                       assert
c1
==
c2


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   10
Grab a grape!

   • Simple distribution and sharing of Groovy scripts
   • Dependencies stored locally
           – Can even use your own local repositories


                                 @Grab(group


=
'org.mortbay.jetty',
                                 





module

=
'jetty‐embedded',
                                 





version
=
'6.1.0')
                                 def
startServer()
{
                                 



def
srv
=
new
Server(8080)
                                                                          SIONS)
                                 



def
ctx
=
new
Context(srv
,
"/",
SES
                                 



ctx.resourceBase
=
"."
                                                                           ovy")
                                 



 ctx.addServlet(GroovyServlet,
"*.gro
                                 



srv.start()
                                 }



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   11
Metaprogramming additions (1/2)

   • ExpandoMetaClass DSL
           – factoring EMC changes



                                    Number.metaClass
{
                                    



multiply
{
Amount
amount
‐>

                                    







amount.times(delegate)

                                    



}
                                    



div
{
Amount
amount
‐>

                                    







amount.inverse().times(delegate)

                                    



}
                                    }




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   12
Metaprogramming additions (2/2)

   • Runtime mixins

                            class
FlyingAbility
{
                            



def
fly()
{
"I'm
${name}
and
I
fly!"
}
                            }

                             class
JamesBondVehicle
{
                             



String
getName()
{
"James
Bond's
vehicle"
}
                             }

                             JamesBondVehicle.mixin
FlyingAbility

                             assert
new
JamesBondVehicle().fly()
==
                             



"I'm
James
Bond's
vehicle
and
I
fly!"



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   13
JMX Builder

• A DSL for handling JMX
        – in addition of Groovy MBean

                                          //
Create
a
connector
server
                                          def
jmx
=
new
JmxBuilder()
                                          jmx.connectorServer(port:9000).start()

                                          //
Create
a
connector
client
                                          jmx.connectorClient(port:9000).connect()

                                          //Export
a
bean
                                          jmx.export
{
bean
new
MyService()
}

                                          //
Defining
a
timer
                                          jmx.timer(name:
"jmx.builder:type=Timer",

                                          



event:
"heartbeat",
period:
"1s").start()

                                           //
JMX
listener
                                           jmx.listener(event:
"someEvent",
from:
"bean",

                                           



call:
{
evt
‐>
/*
do
something
*/
})
Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   14
into the Present...
Big highlights of Groovy 1.7

   • Anonymous Inner Classes and Nested Classes
   • Annotations anywhere
   • Grape improvements
   • Power Asserts
   • AST Viewer
   • AST Builder
   • Customize the Groovy Truth!
   • Rewrite of the GroovyScriptEngine
   • Groovy Console improvements
   • SQL support refinements


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   16
AIC and NC

   • Anonymous Inner Classes and Nested Classes




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   17
AIC and NC

   • Anonymous Inner Classes and Nested Classes




                                             Fo rJ ava
                                                   ’n p aste
                                             c opy
                                                    atib ility
                                              co mp
                                              s ake  :-)

Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   17
Annonymous Inner Classes


                                  bo olean
called
=
false
                                  Timer
ti mer
=
new
Timer()

                                   timer.schedule(n ew
TimerTask()
{
                                   



void
run()
{
                                   


 




called
=
true
                                   



}
                                   },
0)

                                     sleep
100
                                     assert
called



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   18
Annonymous Inner Classes


                                  bo olean
called
=
false
                                  Timer
ti mer
=
new
Timer()

                                   timer.schedule(n  ew
TimerTask()
{
                                   



void
run()
{
                                   


 




called
=
true
                                   



}
                                                  { called = true }
                                   },
0)                            as
                                                  TimerTask
                                    sleep
100
                                    assert
called



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   18
Nested Classes



                                   class
Environment
{
                                   



static
class
Production
                                   








extends
Environment
{}
                                   



static
class
Development
                                   








extends
Environment
{}
                                   }

                                    new
Environment.Production()




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   19
Anotations anywhere


   • You can now put annotations
           – on imports
           – on packages
           – on variable declarations


   • Examples with @Grab following...




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   20
Grape improvements (1/3)

   • @Grab on import

                      @Grab(group
=
'net.sf.json‐lib',

                      




module
=
'json‐lib',

                      



version
=
'2.3',
                      
classifier
=
'jdk15')
                      import
net.sf.json.groovy.*

                       assert
new
JsonSlurper().parseText(
                       new
JsonGroovyBuilder().json
{
                       



book(title:
"Groovy
in
Action",
                       







author:
"Dierk
König
et
al")
                                                                  ion"
                       }.toString()).book.title
==
"Groovy
in
Act




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   21
Grape improvements (2/3)

   • Shorter module / artifact / version parameter
           – Example of an annotation on a variable declaration



             @Grab('net.sf.json‐lib:json‐lib:2.3:jdk15')
                                                                    ()
             def
builder
=
new
net.sf.json.groovy.JsonGroovyBuilder

              def
books
=
builder.books
{
                                                                     nig")
              



book(title:
"Groovy
in
Action",
author:
"Dierk
Koe
              }
              assert
books.toString()
==
              



'{"books":{"book":{"title":"Groovy
in
Action",'
+

              



'"author":"Dierk
Koenig"}}}'




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   22
Grape improvements (3/3)

   • Groovy 1.7 introduced Grab resolver
           – For when you need to specify a specific repository
             for a given dependency



             @GrabResolver(
             



name
=
'restlet.org',
             



root
=
'http://maven.restlet.org')
             @Grab('org.restlet:org.restlet:1.1.6')
             import
org.restlet.Restlet



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   23
Power Asserts (1/2)

   • Much better assert statement!
           – Invented and developed in the Spock framework


   • Given this script...


             def
energy
=
7200
*
10**15
+
1
             def
mass
=
80
             def
celerity
=
300000000

              assert
energy
==
mass
*
celerity
**
2

Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   24
Power Asserts (2/2)

   • You’ll get a more comprehensible output




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   25
Easier AST Transformations

   • AST Transformations are a very powerful feature
   • But are still rather hard to develop
           – Need to know the AST API closely


   • To help with authoring your own transformations,
     we’ve introduced
           – the AST Viewer in the Groovy Console
           – the AST Builder




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   26
AST Viewer




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   27
AST Builder

            //
Ability
to
build
AST
parts
            //
‐‐>
from
a
String
            new
AstBui lder().buildFromString('''
"Hello"
''')

             //
‐‐>
from
code
             new
AstBuilder().buildFromCode
{
"Hello"
}

             //
‐‐>
from
a
specification
                                                                   
{
             List<ASTNo de>
nodes
=
new
AstBuilder().buildFromSpec
             



block
{
             







returnStatement
{
             











constant
"Hello"
             







}
             



}
             }


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   28
Customize the Groovy Truth!

   • Ability to customize the truth by implementing a
     boolean asBoolean() method


                 class
Predicate
{
                 



boolean
value
                 



boolean
asBoolean()
{
value
}
                 }

                  def
tr uePred

=
new
Predicate(value:
true)
                  def
fals ePred
=
new
Predicate(value:
false)

                  assert
truePred
&&
!falsePred


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   29
SQL support refinements


         //
batch
statements
         sql.withBatch
{
stmt
‐>
                                                       e
‐>
            ["Paul",
"Jochen",
"Guillaume"].each
{
nam                 e)"
               
stmt.addBat ch
"insert
into
PERSON
(name)
values
($nam
            }
         }

          //
transaction
support
          def
persons
=
sql.dataSet("person")
          sql.withTransaction
{
             

persons.add
name:
"Paul"
             

persons.add
name:
"Jochen"
             

persons.add
name:
"Guillaume"
             

persons.add
name:
"Roshan"
          }




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   30
Groovy 1.7.x changes


   • Since Groovy 1.7.0, Groovy 1.7.1, 1.7.2, 1.7.3,
     1.7.4 and 1.7.5 have been released already!

   • Here’s what’s new!




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   31
Map improvements


          //
map
auto‐vification
          def
m
=
[:].withDefault
{
key
‐>
"Default"
}
          assert
m['z']
==
"Default"

          assert
m['a']
==
"Default"

           //
default
sort
           m.sort()

            //
sort
with
a
comparator
            m.sort({
a,
b
‐>
a
<=>
b
}
as
Comparator)



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   32
XML back to String

   • Ability to retrieve the XML string from a node from
     an XmlSlurper GPathResult

         def
xml
=
"""
         <books>
         



 <book
isbn="12345">Groovy
in
Action</book>
         </books>
         """
         def
root
=
new
XmlSlurper().parseText(xml)
         def
someNode
=
root.book
         def
bu ilder
=
new
StreamingMarkupBuilder()

          assert
build er.bindNode(someNode).toString()
==
          







"<book 
isbn='12345'>Groovy
in
Action</book>"


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   33
Currying improvements


       //
right
currying
       def
divide
=
{
a,
b
‐>
a
/
b
}
       def
halver
=
divide.rcurry(2)
       assert
halver(8)
==
4
       

       //
currying
n‐th
parameter
       def
jo inWithSeparator
=
{
one,
sep,
two
‐>
       



one
+
sep
+
two
       }
       def
joinWithComma
=

       



jo inWithSeparator.ncurry(1,
',
')
        assert
joinWithComma('a',
'b')
==
'a,
b'


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   34
New String methods

                  println
"""                                                                                 println
"""
                  



def
method()
{                                                                          



|def
method()
{
                  







return
'bar'                                                                        



|



return
'bar'
                  



}                                                                                       



|}
                  """.stripIndent()                                                                           """.stripMargin('|')


                   //
string
"translation"
(UNIX
tr)
                   assert
'hello'.tr('z‐a',
'Z‐A')
==
'HELLO'
                                                                   
WAAAA!'
                   asse rt
'Hello
World!'.tr('a‐z',
'A')
==
'HAAAA
                                                                            2d!'
                   assert
'Hell o
World!'.tr('lloo',
'1234')
==
'He224
W4r

                     //
capitalize
the
first
letter
                     assert
'h'.capitalize()
==
'H'
                     assert
'hello'.capitalize()
==
'Hello'
                                                                     rld'
                     asse rt
'hello
world'.capitalize()
==
'Hello
wo
                                                                mmand)
                     //
tab/space
(un)expansion
(UNIX
expand
co
                                                                7
8







'
                     assert
'1234567t8t
'.expand()
==
'123456
                                                                '
                     assert
'



x



'.unexpand()
==
'



xt



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.                    35
...and beyond!
Groovy 1.8 & beyond

   • Still subject to discussion
   • Always evolving roadmap
   • Things may change!




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   37
What’s cooking?
What we’re working on

   • More runtime performance improvements
   • Closure annotation parameters
   • Closure composition
   • New AST transformations
   • Gradle build
   • Modularizing Groovy
   • Align with JDK 7 / Java 7 / Project Coin
   • Enhanced DSL support
   • AST Templates



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   39
Closure annotation parameters

   • Groovy 1.5 brought Java 5 annotations
   • What if... we could go beyond what Java offered?
           – In 1.7, we can put annotations on packages, imports and
             variable declarations
           – But annotations are still limited in terms of parameters
             they allow


   • Here comes closure annotation parameters!
           – Groovy 1.8 will give us the ability to access annotation
             with closure parameters at runtime




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   40
GContracts

   • Closures are already allowed in the Groovy 1.7 Antlr
     grammar
           – André Steingreß created GContracts,
             a «design by contract» module


             //
a
class
invariant
             @I nvariant({
name.size()
>
0
&&
age
>
ageLimit()
})
             

             //
a
method
pre‐condition
             @Requires({
message
!=
null
})
             

             //
a
method
post‐condition
             @Ensures({
returnResult
%
2
==
0
})


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   41
Closure composition

   • Functional flavor!

             def
plus2

=
{
it
+
2
}
             def
times3
=
{
it
*
3
}
             

             def
composed1
=
plus2
<<
times3
             assert
composed1(3)
==
11
             assert
composed1(4)
==
plus2(times3(4))
             

             def
composed2
=
times3
<<
plus2
             assert
composed2(3)
==
15
             assert
composed2(5)
==
times3(plus2(5))
             

             //
reverse
composition
             assert
composed1(3)
==
(times3
>>
plus2)(3)

Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   42
build
          dh oc    oo vy
   or  e a lar Gr
 M       o du Hans!
  or e m rom
M        ef
   M  or
More modular build

   • «Not everybody needs everything!» ™

   • A lighter Groovy-core
           – what’s in groovy-all?


   • Modules
           – test, jmx, swing, xml, sql, web, template
           – integration (bsf, jsr-223)
           – tools (groovydoc, groovyc, shell, console, java2groovy)




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   44
Java 7 (or 8?) / Project Coin

   • JSR-292 InvokeDynamic

   • Simple Closures?

   • Proposals from Project Coin
           – Strings in switch
           – Automatic Resource Management
           – Improved generics type inference (diamond <>)
           – Simplified varargs method invocation
           – Better integral literals
           – Language support for collections


Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   45
Improved DSL support


   • GEP-3: an extended command expression DSL
           – Groovy Extension Proposal #3



   • Command expressions
           – basically top-level statements without parens
           – combine named and non-named arguments in the mix
                  •for nicer Domain-Specific Languages
           – (methodName arguments )*



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   46
Before GEP-3

   • The idea: extend command-expressions, beyond
     top-level statements, for chained method calls
   • Before

                          send("Hello").to("Graeme")

                          check(that:
margherita).tastes(good)

                          sell(100.shares).of(MSFT)

                          take(2.pills).of(chloroquinine).after(6.hours)

                          wait(10.minutes).and(execute
{

})

                           blend(red,
green).of(acrylic)



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   47
With GEP-3

   • The idea: extend command-expressions, beyond
     top-level statements, for chained method calls
   • After

                          send
"Hello"

to
"Graeme"

                          check
that:
margherita

tastes
good

                          sell
100.shares

of
MSFT

                          take
2.pills

of
chloroquinine

after
6.hours

                          wait
10.minutes

and
execute
{

}

                           blend
red,
green

of
acrylic



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   48
With GEP-3

   • The idea: extend command-expressions, beyond
     top-level statements, for chained method calls
   • After
                                                                                                                     Less
                                                                                                                     & co  pare
                                                                                                                                ns
                          send
"Hello"

to
"Graeme"

                          check
that:
margherita

tastes
good                                                             mm
                          sell
100.shares

of
MSFT
                                                                                                                             as
                          take
2.pills

of
chloroquinine

after
6.hours

                          wait
10.minutes

and
execute
{

}

                           blend
red,
green

of
acrylic



Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.                   48
Summary (1/2)

• No need to wait for Java 7, 8, 9...
        – closures, properties, interpolated strings, extended
          annotations, metaprogramming, [YOU NAME IT]...




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   49
Summary (1/2)

• No need to wait for Java 7, 8, 9...
        – closures, properties, interpolated strings, extended
          annotations, metaprogramming, [YOU NAME IT]...




                                                    ’s s till
                                           Gro  ovy
                                                 ova tive
                                            inn
                                                   20  03!
                                            si nce
Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   49
Summary (2/2)

   • But it’s more than just a language, it’s a very rich
     and active ecosystem!
           – Grails, Griffon, Gradle, GPars, Spock, Gaelyk...




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   50
Thanks for your attention!




                                                                               e
                                                                       e Laforg velopment
                                                            Gui llaum ovy De          m
                                                                   of Gro e@gmail.co
                                                            Head laforg
                                                                     g
                                                             Email: @glaforge
                                                                    r:
                                                             Twitte




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   51
Questions & Answers




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   52
Images used in this
  presentation
   • House / past: http://www.flickr.com/photos/jasonepowell/3680030831/sizes/o/
   • Present clock: http://www.flickr.com/photos/38629278@N04/3784344944/sizes/o/
   • Future: http://www.flickr.com/photos/befuddledsenses/2904000882/sizes/l/
   • Cooking: http://www.flickr.com/photos/eole/449958332/sizes/l/
   • Puzzle: http://www.everystockphoto.com/photo.php?imageId=263521
   • Light bulb:                 https://newsline.llnl.gov/retooling/mar/03.28.08_images/lightBulb.png




Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.   53

More Related Content

What's hot

Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
Matteo Battaglio
 
NIO and NIO2
NIO and NIO2NIO and NIO2
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent ProgrammingTobias Lindaaker
 
Java NIO.2
Java NIO.2Java NIO.2
Java NIO.2
*instinctools
 
JAVA NIO
JAVA NIOJAVA NIO
JAVA NIO
오석 한
 
MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用
iammutex
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronizationfangjiafu
 
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume LaforgeGR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
GR8Conf
 
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyスローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyYusuke Yamamoto
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamic
Ian Robertson
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
Tobias Lindaaker
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to Advanced
Espeo Software
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
GR8Conf
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Stanislav Tiurikov
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap Dumps
Andrei Pangin
 
Vulkan 1.0 Quick Reference
Vulkan 1.0 Quick ReferenceVulkan 1.0 Quick Reference
Vulkan 1.0 Quick Reference
The Khronos Group Inc.
 
Do we need Unsafe in Java?
Do we need Unsafe in Java?Do we need Unsafe in Java?
Do we need Unsafe in Java?
Andrei Pangin
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
Andrei Pangin
 

What's hot (20)

Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
NIO and NIO2
NIO and NIO2NIO and NIO2
NIO and NIO2
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
 
分散式系統
分散式系統分散式系統
分散式系統
 
Java NIO.2
Java NIO.2Java NIO.2
Java NIO.2
 
JAVA NIO
JAVA NIOJAVA NIO
JAVA NIO
 
MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization
 
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume LaforgeGR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge
 
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudyスローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
スローダウン、ハングを一発解決 スレッドダンプはトラブルシューティングの味方 #wlstudy
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamic
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to Advanced
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap Dumps
 
Vulkan 1.0 Quick Reference
Vulkan 1.0 Quick ReferenceVulkan 1.0 Quick Reference
Vulkan 1.0 Quick Reference
 
Do we need Unsafe in Java?
Do we need Unsafe in Java?Do we need Unsafe in Java?
Do we need Unsafe in Java?
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
 

Similar to Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge

Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGroovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGuillaume Laforge
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And Beyond
Mike Fogus
 
Groovy Fly Through
Groovy Fly ThroughGroovy Fly Through
Groovy Fly Throughniklal
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
Michiel Borkent
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Skills Matter
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
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
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019
Leonardo Borges
 
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
Andres Almiray
 
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Guido Chari
 
Clojure and Modularity
Clojure and ModularityClojure and Modularity
Clojure and Modularityelliando dias
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
Caridy Patino
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
John Stevenson
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
Viliam Elischer
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
Michiel Borkent
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
Luke Donnet
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)
Jacek Laskowski
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
Domenic Denicola
 

Similar to Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge (20)

Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGroovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And Beyond
 
Groovy Fly Through
Groovy Fly ThroughGroovy Fly Through
Groovy Fly Through
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
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...
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019
 
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
 
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual Machines
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
Clojure and Modularity
Clojure and ModularityClojure and Modularity
Clojure and Modularity
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 

More from Guillaume Laforge

Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
Guillaume Laforge
 
Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013
Guillaume Laforge
 
Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013
Guillaume Laforge
 
Groovy 2 and beyond
Groovy 2 and beyondGroovy 2 and beyond
Groovy 2 and beyond
Guillaume Laforge
 
Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Guillaume Laforge
 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
Guillaume Laforge
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012
Guillaume Laforge
 
Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012
Guillaume Laforge
 
JavaOne 2012 Groovy update
JavaOne 2012 Groovy updateJavaOne 2012 Groovy update
JavaOne 2012 Groovy update
Guillaume Laforge
 
Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Guillaume Laforge
 
Groovy 1.8 and 2.0 at GR8Conf Europe 2012
Groovy 1.8 and 2.0 at GR8Conf Europe 2012Groovy 1.8 and 2.0 at GR8Conf Europe 2012
Groovy 1.8 and 2.0 at GR8Conf Europe 2012Guillaume Laforge
 
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume LaforgeGroovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Guillaume Laforge
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
Guillaume Laforge
 
Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012
Guillaume Laforge
 
Whats new in Groovy 2.0?
Whats new in Groovy 2.0?Whats new in Groovy 2.0?
Whats new in Groovy 2.0?
Guillaume Laforge
 
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Guillaume Laforge
 
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGuillaume Laforge
 
Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011
Guillaume Laforge
 
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
Guillaume Laforge
 
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
Guillaume Laforge
 

More from Guillaume Laforge (20)

Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
 
Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013
 
Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013
 
Groovy 2 and beyond
Groovy 2 and beyondGroovy 2 and beyond
Groovy 2 and beyond
 
Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012
 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012
 
Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012
 
JavaOne 2012 Groovy update
JavaOne 2012 Groovy updateJavaOne 2012 Groovy update
JavaOne 2012 Groovy update
 
Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012
 
Groovy 1.8 and 2.0 at GR8Conf Europe 2012
Groovy 1.8 and 2.0 at GR8Conf Europe 2012Groovy 1.8 and 2.0 at GR8Conf Europe 2012
Groovy 1.8 and 2.0 at GR8Conf Europe 2012
 
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume LaforgeGroovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012
 
Whats new in Groovy 2.0?
Whats new in Groovy 2.0?Whats new in Groovy 2.0?
Whats new in Groovy 2.0?
 
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
 
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
 
Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011
 
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
Gaelyk update - Guillaume Laforge - SpringOne2GX 2011
 
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
Groovy Update, what's new in Groovy 1.8 and beyond - Guillaume Laforge - Spri...
 

Recently uploaded

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
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
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
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...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
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 !
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 

Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge

  • 2. Guillaume Laforge • Groovy Project Manager • JSR-241 Spec Lead • Head of Groovy Development at SpringSource • Initiator of the Grails framework • Co-author of Groovy in Action • Speaker: JavaOne, QCon, JavaZone, Sun TechDays, Devoxx, The Spring Experience, SpringOne, JAX, Dynamic Language World, IJTC, and more... Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 2
  • 3. Agenda •Past – Groovy 1.6 flashback •Present – Groovy 1.7 novelties – A few Groovy 1.7.x refinements •Future – What’s cooking for 1.8 and beyond Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 3
  • 5. Big highlights of Groovy 1.6 • Greater compile-time and runtime performance • Multiple assignments • Optional return for if/else and try/catch/finally • Java 5 annotation definition • AST Transformations • The Grape module and dependency system • Various Swing related improvements • JMX Builder • Metaprogramming additions • JSR-223 scripting engine built-in • Out-of-the-box OSGi support Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 5
  • 6. Multiple assignement //
multiple
assignment def
(a,
b)
=
[1,
2] assert
a
==
1
&&
b
==
2 //
with
typed
variables def
(int
c,
String
d)
=
[3,
"Hi"] assert
c
==
3
&&
d
==
"Hi" def
geocode(String
place)
{
[48.8,
2.3]
} def
lat,
lng //
assignment
to
existing
variables (lat,
lng)
=
geocode('Paris') //
classical
variable
swaping
example (a,
b)
=
[b,
a] Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 6
  • 7. More optional return //
optional
return
for
if
statements def
m1()
{ 



if
(true)
1 



else
0 } assert
m1()
==
1 //
optional
return
for
try/catch/finally def
m2(bool)
{ 



try
{ 







if
(bool)
throw
new
Exception() 







1 



}
catch
(any)
{
2
} 



finally
{
3
} } assert
m2(true)
==
2
&&
m2(false)
==
1 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 7
  • 8. AST Transformation (1/2) • Groovy 1.6 introduced AST Transformations • AST: Abstract Syntax Tree • Ability to change what’s being compiled by the Groovy compiler... at compile time – No runtime impact! – Change the semantics of your programs! Even hijack the Groovy syntax! – Implementing recurring patterns in your code base – Remove boiler-plate code • Two kinds: global and local (triggered by anno) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 8
  • 9. AST Transformations (2/2) • Transformations introduced in 1.6 – @Singleton – @Immutable, @Lazy, @Delegate – @Newify – @Category, @Mixin – @PackageScope – Swing’s @Bindable and @Vetoable – Grape’s own @Grab Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 9
  • 10. @Immutable • To properly implement immutable classes – No mutations — state musn’t change – Private final fields – Defensive copying of mutable components – Proper equals() / hashCode() / toString() for comparisons or fas keys in maps @Immutable
class
Coordinates
{ 



Double
lat,
lng } def
c1
=
new
Coordinates(lat:
48.8,
lng:
2.5) def
c2
=
new
Coordinates(48.8,
2.5) assert
c1
==
c2 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 10
  • 11. Grab a grape! • Simple distribution and sharing of Groovy scripts • Dependencies stored locally – Can even use your own local repositories @Grab(group


=
'org.mortbay.jetty', 





module

=
'jetty‐embedded', 





version
=
'6.1.0') def
startServer()
{ 



def
srv
=
new
Server(8080) SIONS) 



def
ctx
=
new
Context(srv
,
"/",
SES 



ctx.resourceBase
=
"." ovy") 



 ctx.addServlet(GroovyServlet,
"*.gro 



srv.start() } Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 11
  • 12. Metaprogramming additions (1/2) • ExpandoMetaClass DSL – factoring EMC changes Number.metaClass
{ 



multiply
{
Amount
amount
‐>
 







amount.times(delegate)
 



} 



div
{
Amount
amount
‐>
 







amount.inverse().times(delegate)
 



} } Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 12
  • 13. Metaprogramming additions (2/2) • Runtime mixins class
FlyingAbility
{ 



def
fly()
{
"I'm
${name}
and
I
fly!"
} } class
JamesBondVehicle
{ 



String
getName()
{
"James
Bond's
vehicle"
} } JamesBondVehicle.mixin
FlyingAbility assert
new
JamesBondVehicle().fly()
== 



"I'm
James
Bond's
vehicle
and
I
fly!" Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 13
  • 14. JMX Builder • A DSL for handling JMX – in addition of Groovy MBean //
Create
a
connector
server def
jmx
=
new
JmxBuilder() jmx.connectorServer(port:9000).start() //
Create
a
connector
client jmx.connectorClient(port:9000).connect() //Export
a
bean jmx.export
{
bean
new
MyService()
} //
Defining
a
timer jmx.timer(name:
"jmx.builder:type=Timer",
 



event:
"heartbeat",
period:
"1s").start() //
JMX
listener jmx.listener(event:
"someEvent",
from:
"bean",
 



call:
{
evt
‐>
/*
do
something
*/
}) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 14
  • 16. Big highlights of Groovy 1.7 • Anonymous Inner Classes and Nested Classes • Annotations anywhere • Grape improvements • Power Asserts • AST Viewer • AST Builder • Customize the Groovy Truth! • Rewrite of the GroovyScriptEngine • Groovy Console improvements • SQL support refinements Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16
  • 17. AIC and NC • Anonymous Inner Classes and Nested Classes Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17
  • 18. AIC and NC • Anonymous Inner Classes and Nested Classes Fo rJ ava ’n p aste c opy atib ility co mp s ake :-) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17
  • 19. Annonymous Inner Classes bo olean
called
=
false Timer
ti mer
=
new
Timer() timer.schedule(n ew
TimerTask()
{ 



void
run()
{ 


 




called
=
true 



} },
0) sleep
100 assert
called Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18
  • 20. Annonymous Inner Classes bo olean
called
=
false Timer
ti mer
=
new
Timer() timer.schedule(n ew
TimerTask()
{ 



void
run()
{ 


 




called
=
true 



} { called = true } },
0) as TimerTask sleep
100 assert
called Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18
  • 21. Nested Classes class
Environment
{ 



static
class
Production 








extends
Environment
{} 



static
class
Development 








extends
Environment
{} } new
Environment.Production() Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 19
  • 22. Anotations anywhere • You can now put annotations – on imports – on packages – on variable declarations • Examples with @Grab following... Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 20
  • 23. Grape improvements (1/3) • @Grab on import @Grab(group
=
'net.sf.json‐lib',
 




module
=
'json‐lib',
 



version
=
'2.3', 
classifier
=
'jdk15') import
net.sf.json.groovy.* assert
new
JsonSlurper().parseText( new
JsonGroovyBuilder().json
{ 



book(title:
"Groovy
in
Action", 







author:
"Dierk
König
et
al") ion" }.toString()).book.title
==
"Groovy
in
Act Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 21
  • 24. Grape improvements (2/3) • Shorter module / artifact / version parameter – Example of an annotation on a variable declaration @Grab('net.sf.json‐lib:json‐lib:2.3:jdk15') () def
builder
=
new
net.sf.json.groovy.JsonGroovyBuilder def
books
=
builder.books
{ nig") 



book(title:
"Groovy
in
Action",
author:
"Dierk
Koe } assert
books.toString()
== 



'{"books":{"book":{"title":"Groovy
in
Action",'
+
 



'"author":"Dierk
Koenig"}}}' Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 22
  • 25. Grape improvements (3/3) • Groovy 1.7 introduced Grab resolver – For when you need to specify a specific repository for a given dependency @GrabResolver( 



name
=
'restlet.org', 



root
=
'http://maven.restlet.org') @Grab('org.restlet:org.restlet:1.1.6') import
org.restlet.Restlet Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 23
  • 26. Power Asserts (1/2) • Much better assert statement! – Invented and developed in the Spock framework • Given this script... def
energy
=
7200
*
10**15
+
1 def
mass
=
80 def
celerity
=
300000000 assert
energy
==
mass
*
celerity
**
2 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 24
  • 27. Power Asserts (2/2) • You’ll get a more comprehensible output Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 25
  • 28. Easier AST Transformations • AST Transformations are a very powerful feature • But are still rather hard to develop – Need to know the AST API closely • To help with authoring your own transformations, we’ve introduced – the AST Viewer in the Groovy Console – the AST Builder Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 26
  • 29. AST Viewer Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 27
  • 30. AST Builder //
Ability
to
build
AST
parts //
‐‐>
from
a
String new
AstBui lder().buildFromString('''
"Hello"
''') //
‐‐>
from
code new
AstBuilder().buildFromCode
{
"Hello"
} //
‐‐>
from
a
specification 
{ List<ASTNo de>
nodes
=
new
AstBuilder().buildFromSpec 



block
{ 







returnStatement
{ 











constant
"Hello" 







} 



} } Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 28
  • 31. Customize the Groovy Truth! • Ability to customize the truth by implementing a boolean asBoolean() method class
Predicate
{ 



boolean
value 



boolean
asBoolean()
{
value
} } def
tr uePred

=
new
Predicate(value:
true) def
fals ePred
=
new
Predicate(value:
false) assert
truePred
&&
!falsePred Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 29
  • 32. SQL support refinements //
batch
statements sql.withBatch
{
stmt
‐> e
‐> ["Paul",
"Jochen",
"Guillaume"].each
{
nam e)" 
stmt.addBat ch
"insert
into
PERSON
(name)
values
($nam } } //
transaction
support def
persons
=
sql.dataSet("person") sql.withTransaction
{ 

persons.add
name:
"Paul" 

persons.add
name:
"Jochen" 

persons.add
name:
"Guillaume" 

persons.add
name:
"Roshan" } Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 30
  • 33. Groovy 1.7.x changes • Since Groovy 1.7.0, Groovy 1.7.1, 1.7.2, 1.7.3, 1.7.4 and 1.7.5 have been released already! • Here’s what’s new! Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 31
  • 34. Map improvements //
map
auto‐vification def
m
=
[:].withDefault
{
key
‐>
"Default"
} assert
m['z']
==
"Default"
 assert
m['a']
==
"Default" //
default
sort m.sort() //
sort
with
a
comparator m.sort({
a,
b
‐>
a
<=>
b
}
as
Comparator) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 32
  • 35. XML back to String • Ability to retrieve the XML string from a node from an XmlSlurper GPathResult def
xml
=
""" <books> 



 <book
isbn="12345">Groovy
in
Action</book> </books> """ def
root
=
new
XmlSlurper().parseText(xml) def
someNode
=
root.book def
bu ilder
=
new
StreamingMarkupBuilder() assert
build er.bindNode(someNode).toString()
== 







"<book 
isbn='12345'>Groovy
in
Action</book>" Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 33
  • 36. Currying improvements //
right
currying def
divide
=
{
a,
b
‐>
a
/
b
} def
halver
=
divide.rcurry(2) assert
halver(8)
==
4 
 //
currying
n‐th
parameter def
jo inWithSeparator
=
{
one,
sep,
two
‐> 



one
+
sep
+
two } def
joinWithComma
=
 



jo inWithSeparator.ncurry(1,
',
') assert
joinWithComma('a',
'b')
==
'a,
b' Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 34
  • 37. New String methods println
""" println
""" 



def
method()
{ 



|def
method()
{ 







return
'bar' 



|



return
'bar' 



} 



|} """.stripIndent() """.stripMargin('|') //
string
"translation"
(UNIX
tr) assert
'hello'.tr('z‐a',
'Z‐A')
==
'HELLO' 
WAAAA!' asse rt
'Hello
World!'.tr('a‐z',
'A')
==
'HAAAA 2d!' assert
'Hell o
World!'.tr('lloo',
'1234')
==
'He224
W4r //
capitalize
the
first
letter assert
'h'.capitalize()
==
'H' assert
'hello'.capitalize()
==
'Hello' rld' asse rt
'hello
world'.capitalize()
==
'Hello
wo mmand) //
tab/space
(un)expansion
(UNIX
expand
co 7
8







' assert
'1234567t8t
'.expand()
==
'123456 ' assert
'



x



'.unexpand()
==
'



xt
 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 35
  • 39. Groovy 1.8 & beyond • Still subject to discussion • Always evolving roadmap • Things may change! Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 37
  • 41. What we’re working on • More runtime performance improvements • Closure annotation parameters • Closure composition • New AST transformations • Gradle build • Modularizing Groovy • Align with JDK 7 / Java 7 / Project Coin • Enhanced DSL support • AST Templates Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 39
  • 42. Closure annotation parameters • Groovy 1.5 brought Java 5 annotations • What if... we could go beyond what Java offered? – In 1.7, we can put annotations on packages, imports and variable declarations – But annotations are still limited in terms of parameters they allow • Here comes closure annotation parameters! – Groovy 1.8 will give us the ability to access annotation with closure parameters at runtime Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 40
  • 43. GContracts • Closures are already allowed in the Groovy 1.7 Antlr grammar – André Steingreß created GContracts, a «design by contract» module //
a
class
invariant @I nvariant({
name.size()
>
0
&&
age
>
ageLimit()
}) 
 //
a
method
pre‐condition @Requires({
message
!=
null
}) 
 //
a
method
post‐condition @Ensures({
returnResult
%
2
==
0
}) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 41
  • 44. Closure composition • Functional flavor! def
plus2

=
{
it
+
2
} def
times3
=
{
it
*
3
} 
 def
composed1
=
plus2
<<
times3 assert
composed1(3)
==
11 assert
composed1(4)
==
plus2(times3(4)) 
 def
composed2
=
times3
<<
plus2 assert
composed2(3)
==
15 assert
composed2(5)
==
times3(plus2(5)) 
 //
reverse
composition assert
composed1(3)
==
(times3
>>
plus2)(3) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 42
  • 45.
  • 46.
  • 47. build dh oc oo vy or e a lar Gr M o du Hans! or e m rom M ef M or
  • 48. More modular build • «Not everybody needs everything!» ™ • A lighter Groovy-core – what’s in groovy-all? • Modules – test, jmx, swing, xml, sql, web, template – integration (bsf, jsr-223) – tools (groovydoc, groovyc, shell, console, java2groovy) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 44
  • 49. Java 7 (or 8?) / Project Coin • JSR-292 InvokeDynamic • Simple Closures? • Proposals from Project Coin – Strings in switch – Automatic Resource Management – Improved generics type inference (diamond <>) – Simplified varargs method invocation – Better integral literals – Language support for collections Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 45
  • 50. Improved DSL support • GEP-3: an extended command expression DSL – Groovy Extension Proposal #3 • Command expressions – basically top-level statements without parens – combine named and non-named arguments in the mix •for nicer Domain-Specific Languages – (methodName arguments )* Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 46
  • 51. Before GEP-3 • The idea: extend command-expressions, beyond top-level statements, for chained method calls • Before send("Hello").to("Graeme") check(that:
margherita).tastes(good) sell(100.shares).of(MSFT) take(2.pills).of(chloroquinine).after(6.hours) wait(10.minutes).and(execute
{

}) blend(red,
green).of(acrylic) Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 47
  • 52. With GEP-3 • The idea: extend command-expressions, beyond top-level statements, for chained method calls • After send
"Hello"

to
"Graeme" check
that:
margherita

tastes
good sell
100.shares

of
MSFT take
2.pills

of
chloroquinine

after
6.hours wait
10.minutes

and
execute
{

} blend
red,
green

of
acrylic Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 48
  • 53. With GEP-3 • The idea: extend command-expressions, beyond top-level statements, for chained method calls • After Less & co pare ns send
"Hello"

to
"Graeme" check
that:
margherita

tastes
good mm sell
100.shares

of
MSFT as take
2.pills

of
chloroquinine

after
6.hours wait
10.minutes

and
execute
{

} blend
red,
green

of
acrylic Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 48
  • 54. Summary (1/2) • No need to wait for Java 7, 8, 9... – closures, properties, interpolated strings, extended annotations, metaprogramming, [YOU NAME IT]... Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 49
  • 55. Summary (1/2) • No need to wait for Java 7, 8, 9... – closures, properties, interpolated strings, extended annotations, metaprogramming, [YOU NAME IT]... ’s s till Gro ovy ova tive inn 20 03! si nce Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 49
  • 56. Summary (2/2) • But it’s more than just a language, it’s a very rich and active ecosystem! – Grails, Griffon, Gradle, GPars, Spock, Gaelyk... Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 50
  • 57. Thanks for your attention! e e Laforg velopment Gui llaum ovy De m of Gro e@gmail.co Head laforg g Email: @glaforge r: Twitte Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 51
  • 58. Questions & Answers Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 52
  • 59. Images used in this presentation • House / past: http://www.flickr.com/photos/jasonepowell/3680030831/sizes/o/ • Present clock: http://www.flickr.com/photos/38629278@N04/3784344944/sizes/o/ • Future: http://www.flickr.com/photos/befuddledsenses/2904000882/sizes/l/ • Cooking: http://www.flickr.com/photos/eole/449958332/sizes/l/ • Puzzle: http://www.everystockphoto.com/photo.php?imageId=263521 • Light bulb: https://newsline.llnl.gov/retooling/mar/03.28.08_images/lightBulb.png Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 53

Editor's Notes