SlideShare a Scribd company logo
1 of 53
Download to read offline
What’s new in Groovy 1.6?


Get started with Groovy and learn about
 all the novelties in the latest release

         Guillaume Laforge
     Head of Groovy Development
Guillaume Laforge
Groovy Project Manager — SpringSource


>   Working on Groovy since 2003
>   JSR-241 Spec Lead

>   Initiator of the Grails web framework

>   Co-author of Groovy in Action

>   Speaker: JavaOne, QCon, JavaPolis/Devoxx,
    JavaZone, Sun Tech Days, SpringOne/The Spring
    Experience, JAX, DSL DevCon, and more…



                                             3
What’s new in Groovy 1.6?
Article Published by InfoQ




>   This presentation was prepared with the examples
    I’ve used in my article written for InfoQ

>   http://www.infoq.com/articles/groovy-1-6

>   Read this article for more detailed explanations of
    all the new features in Groovy 1.6



                                                 4
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    5
Groovy in a Nutshell
Simplify the Life of Java Developers

>   Groovy is a dynamic language for the JVM
       With a Meta-Object Protocol
       Compiles down to bytecode

>   Open Source Apache licensed project

>   Relaxed grammar derived from the Java 5 grammar
       Borrowed some good ideas from Smalltalk/Python/Ruby
       Java 5 features out of the box:
           annotations, generics, static imports, enums…
       Flat learning curve




                                                            6
A Taste of Groovy — Take 1
A Normal Java Program
>   public class HelloWorld {
        private String name;
        public void setName(String name) {
            this.name = name;
        }
        public String getName() {
            return name;
        }
        public String greet() {
            return "Hello " + name;
        }
        public static void main(String[] args) {
            HelloWorld helloWorld = new HelloWorld();
            helloWorld.setName("Groovy");
            System.out.println( helloWorld.greet() );
        }
    }




                                                        7
A Taste of Groovy — Take 2
A Normal Groovy Program
>   public class HelloWorld {
        private String name;
        public void setName(String name) {
            this.name = name;
        }
        public String getName() {
            return name;
        }
        public String greet() {
            return "Hello " + name;
        }
        public static void main(String[] args) {
            HelloWorld helloWorld = new HelloWorld();
            helloWorld.setName("Groovy");
            System.out.println( helloWorld.greet() );
        }
    }




                                                        8
A Taste of Groovy — Take 3
A Groovier Program

>   class HelloWorld {
        String name
        String greet() { "Hello $name" }
    }

    def helloWorld = new HelloWorld(name: "Groovy")
    println helloWorld.greet()




                                                      9
The Groovy Web Console
A Groovy Playground



>   Groovy works nicely on Google App Engine
       You can also deploy Grails applications

>   You can play with Groovy in the web console
       http://groovyconsole.appspot.com/




                                                  10
The Groovy Web Console
A Screenshot




                         11
Features at a Glance

>   Fully Object-Oriented
>   Joint compiler: seamless Java integration
>   Closures: reusable blocks of code / anon functions
>   Properties: forget about getters and setters
>   Optional typing: your choice!
>   BigDecimal arithmetic by default for floating point
>   Handy APIs
     XML, JDBC, JMX, template engine, Swing UIs

>   Strong ability for authoring Domain-Specific
    Languages
     Syntax-level “builders”

     Adding properties to numbers: 10.dollars

     Operator overloading: 10.meters + 20.kilometers



                                                 12
Joint Compilation

• Total Java interoperability
• Concretely, what does it mean?


            JInterface       GInterface


           <<implements>>   <<implements>>


             GClass            JClass




              JClass           GClass




                                             13
Native Syntax Constructs

• Lists
  – def numbers = [1, 2, 3, 4, 5]

• Maps
  – def map = [FR: ‘France’, BE: ‘Belgium’]

• Ranges
  – def allowed = 18..65

• Regular expressions
  – def whitespace = ~/s+?/
  – if (‘foo’ ==~ /o+/) { ... }


                                              14
GStrings!

• GStrings are... interpolated strings
  – Sorry, not really what you expected!
  – Placeholder variables are replaced
  – You can have multiline strings


• def person = ‘John’
  def letter = “““${new Date()}
      Dear ${person},
      I hope you’re fine!
  ”””




                                           15
Closures

• Closures are reusable and assignable code blocks or
  anonymous functions
  – No need to wait for Java 7/8/9 to get them!
  – def greet = { println “Hello ${it}” }
    greet(“Guillaume”)

• You can pass parameters
  – def greet = { String name ->
        println “Hello ${name}”
    }

• You can passe closures around
  – def method(Closure c) { c(“Hello”) }
    method(greet)

                                                  16
BigDecimal Arithmetic

• Main reason why financial institutions often decide
  to use Groovy for their business rules!
  – Although these days rounding issues are overrated!

• Java vs Groovy for a simple interpolation equation

• BigDecimal uMinusv = c.subtract(a);
  BigDecimal vMinusl = b.subtract(c);
  BigDecimal uMinusl = a.subtract(b);
  return e.multiply(uMinusv)
              .add(d.multiply(vMinusl))
              .divide(uMinusl, 10, BigDecimal.ROUND_HALF_UP);

• (d * (b - c) + e * (c - a)) / (a - b)



                                                      17
Groovy Builders

• The Markup builder
  – Easy way for creating XML or HTML content

  – def mkp = new MarkupBuilder()
    mkp.html {
        head {
            title “Groovy in Action”
        }
        body {
            div(width: ‘100’) {
                p(class: ‘para’) {
                    span “Best book ever!”
                }
            }
        }
    }
                                                18
Parsing XML

• And it’s so easy to parser XML and navigate
  through the node graph!

• def geocodingUrl = "http://...".toURL()
  geocodingUrl.withInputStream { stream ->
      def node = new XmlSlurper().parse(stream)
      if (node.Response.Status.code == "200") {
          def text = node.Response.Placemark.
                     Point.coordinates.text()
          def coord = text.tokenize(',').
                      collect{ Float.parseFloat(it) }
          (latitude, longitude) = coord[1..0]
      }
  }



                                                19
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    20
Performance Improvements
Both Runtime & Compile-Time

>   The Groovyc compiler is 3x to 5x faster
       With a clever class lookup cache

>   Certain online micro-benchmarks show
    150% to 460% increase in performance
    compared to Groovy 1.5
       Thanks to advanced call-site caching techniques
       Beware of micro-benchmarks!

>   Makes Groovy one of the fastest dynamic languages
    available




                                                          21
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    22
Multiple Assignment
Assign Multiple Variables at Once
>   Newly defined variables
       def (a, b) = [1, 2]
        assert a == 1
        assert b == 2

>   Assign to existing variables
       def lat, lng
        (lat, lng) = geocode(‘Paris’)

>   The classical swap case
       (a, b) = [b, a]

>   Extra elements ⇒ not assigned to any variable
>   Less elements ⇒ null into extra variables

                                               23
More Optional Return
    In if/else and try/catch Blocks
>   The return keyword is optional for the last
    expression of a method body
     But if/else & try/catch didn’t return any value



>   def method() { if (true) 1 else 0 }
    assert method() == 1

>   def method(bool) {
        try {
            if (bool) throw new Exception("foo")
            1
        } catch(e) { 2 }
        finally    { 3 }
    }
    assert method(false) == 1
    assert method(true) == 2



                                                   24
Annotation Definition
The Missing Bit of Java 5 Support


>   Groovy support for Java 5 features is now complete
    with the missing annotation definition

>   Nothing to show here, it’s just normal Java :-)

>   Note that the sole dynamic language supporting
    annotation is… Groovy
       Opens the door to EJB3 / JPA / Spring annotations /
        Guice / TestNG…




                                                       25
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    26
Meta-What?
Meta-Programming
>   The ability of a language to modify itself

>   Groovy 1.6 introduces AST Transformations
       Abstract Syntax Tree

>   Goodbye to a lot of boiler-plate technical code!

>   Two kinds of transformations
       Global transformations
       Local transformations: triggered by annotations




                                                          27
AST Transformations in 1.6
Implement Patterns through Transformations
>   Several transformations find their way in Groovy 1.6

       @Singleton — okay, not really a pattern ;-)
       @Immutable, @Lazy, @Delegate
       @Newify
       @Category and @Mixin
       @PackageScope

       Swing’s @Bindable and @Vetoable

       Grape’s @Grab

>   Let’s have a look at some of them!

                                                      28
@Singleton
(Anti-)Pattern Revisited

>   The evil Java singleton
       public class Evil {
            public static final Evil instance = new Evil ();
            private Evil () {}
            Evil getInstance() { return instance; }
        }


>   In Groovy:
       @Singleton class Evil {}

>   There’s also a « lazy » version
       @Singleton(lazy = true) class Evil {}

                                                     29
@Immutable
The Immutable… Boiler-Plate Code

>   To properly implement immutable classes
       No mutators (state musn’t change)
       Private final fields
       Defensive copying of mutable components
       Proper equals() / hashCode() / toString() for
        comparisons or for keys in maps, etc.

>   In Groovy
       @Immutable final 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



                                                        30
@Lazy
Not Just for Lazy Dudes!


>   When you need to lazy evaluate / instantiate
    complex data structures for class fields, mark them
    as @Lazy

       class Dude {
            @Lazy pets = retriveFromSlowDB()
        }

>   Groovy will handle the boiler-plate code for you




                                                 31
@Delegate
Not Just for Managers!

>   You can delegate to fields of your class
       Think multiple inheritance
       class Employee {
            def doTheWork() { "done" }
        }

        class Manager {
            @Delegate
            Employee slave = new Employee()
        }
        def god = new Manager()
        assert god.doTheWork() == "done"

>   Damn manager who will get all the praise…

                                               32
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    33
Grab a Grape
Groovy Advanced Packaging Engine
>   Helps you distribute scripts without dependencies
>   Just declare your dependencies with @Grab
       Will look for dependencies in Maven or Ivy repositories

>   @Grab(group   = 'org.mortbay.jetty',
          module = 'jetty-embedded',
          version = '6.1.0')
    def startServer() {
        def srv = new Server(8080)
        def ctx = new Context(srv , "/", SESSIONS)
        ctx.resourceBase = "."
        ctx.addServlet(GroovyServlet, "*.groovy")
        srv.start()
    }


                                                        34
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    35
@Bindable (1/2)
    Event-Driven Made Easy
>   Speaking of boiler-plate code…
    property change listeners
>   import java.beans.PropertyChangeSupport;
    import java.beans.PropertyChangeListener;

    public class MyBean {
        private String prop;
        PropertyChangeSupport pcs = new PropertyChangeSupport(this);

         public void addPropertyChangeListener(PropertyChangeListener l) {
             pcs.add(l);
         }

         public void removePropertyChangeListener(PropertyChangeListener l) {
             pcs.remove(l);
         }

         public String getProp() {
            return prop;
         }

         public void setProp(String prop) {
              pcs.firePropertyChanged("prop", this.prop, this.prop = prop);
         }
     }


                                                                                36
@Bindable (2/2)
Event-Driven Made Easy
>   Groovy’s solution

       class MyBean {
            @Bindable String prop
        }

>   Interesting in Griffon and Swing builder

       textField text: bind { myBean.prop }

>   Also of interest: @Vetoable



                                               37
Griffon
The Swing MVC Framework


>   Leverages Groovy’s SwingBuilder
    and Grails’ infrastructure
       http://griffon.codehaus.org




                                      38
Swing Console Improvements

>   The console can be run as an applet
>   Code indentation support
>   Script drag’n drop
>   Add JARs in the classpath from the GUI
>   Execution results visualization plugin
>   Clickable stacktraces and error messages

>   Not intended to be a full-blown IDE, but handy




                                               39
40
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness


                                      41
ExpandoMetaClass DSL
Less Repetition
>   EMC is a way to change the behavior of types at
    runtime

>   Before
       Number.metaClass.multiply = { Amount amount ->
                amount.times(delegate) }
        Number.metaClass.div = { Amount amount ->
                amount.inverse().times(delegate) }


>   Now in Groovy 1.6
       Number.metaClass {
          multiply { Amount amount -> amount.times(delegate) }
          div      { Amount amount ->
                     amount.inverse().times(delegate) }
        }



                                                           42
Runtime Mixins
Inject New Behavior to Types at Runtime

>   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!"




                                                 43
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                     44
javax.script.* Scripting APIs
Groovy Scripting Engine Built-In
>   The JSR-223 / javax.script.* scripting engine for
    Groovy is bundled in Groovy 1.6

       import javax.script.*
        def manager = new ScriptEngineManager()
        def engine =
            manager.getEngineByName("groovy")
        assert engine.evaluate("2 + 3") == 5

>   To evaluate Groovy scripts at runtime in your
    application, just drop the Groovy JAR in your
    classpath!


                                                  45
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    46
JMX Builder (1/2)
Domain-Specific Language for JMX

• Simplify JMX handling with a Builder pattern approach
• Declaratively expose Java/Groovy objects as MBeans
• JMX's event model support
   –Inline closures to create event handler & broadcaster
   –Closures for receiving event notifications
• Provides a flexible registration policy for MBean
• Exposes attribute, constructors, operations,
  parameters, and notifications
• Simplified creation of connector servers & clients
• Support for exporting JMX timers
• http://groovy.codehaus.org/Groovy+JmxBuilder

                                                 47
JMX Builder (2/2)
Domain-Specific Language for JMX
>   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: "…", from: "foo",
            call: { event -> …})
                                                    48
nda
Ag e
      >   Groovy Overview
      >   Performance Improvements
      >   Syntax Enhancements
      >   Compile-Time Metaprogramming
      >   The Grape Module System
      >   Swing-Related Improvements
      >   Runtime Metaprogramming
          Additions
      >   JSR-223 Scripting Engine Built-In
      >   JMX Builder
      >   OSGi Readiness
                                    49
OSGi Readiness

>   The Groovy JAR contains OSGi metadata
       Can be reused in OSGi containers out-of-the-box

>   Tutorials on Groovy and OSGi
     http://groovy.codehaus.org/OSGi+and+Groovy
       Will show you how to load Groovy as a service, write,
        publish and consume Groovy services, and more




                                                        50
Summary
Summary
Just Remember that Groovy Rocks! :-)
>   Any Java developer is a Groovy developer!
>   Great for your next-generation general purpose
    programming language, as well as for admin tasks,
    extending apps, writing DSLs...

>   Groovy 1.6 provides
       Important performance gains
       Efficient compile-time metaprogramming hooks
       New useful features (JMX, javax.script.*, etc.)
       A script dependencies system
       Various Swing-related improvements
       Several runtime metaprogramming additions

>   Get it now!
       http://groovy.codehaus.org/Download
                                                          52
Questions & Answers

More Related Content

What's hot

Groovy Grails DevJam Jam Session
Groovy Grails DevJam Jam SessionGroovy Grails DevJam Jam Session
Groovy Grails DevJam Jam SessionMike Hugo
 
Embedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationEmbedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationPaolo Predonzani
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your GroovyAlonso Torres
 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Ken Kousen
 
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 2013Guillaume Laforge
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Johnny Sung
 
groovy rules
groovy rulesgroovy rules
groovy rulesPaul King
 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!Iván López Martín
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with GroovyArturo Herrero
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsMarcin Grzejszczak
 
tictactoe groovy
tictactoe groovytictactoe groovy
tictactoe groovyPaul King
 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyAndres Almiray
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinKai Koenig
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoRodolfo Carvalho
 
Дмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI векеДмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI векеSergey Platonov
 

What's hot (20)

Groovy Grails DevJam Jam Session
Groovy Grails DevJam Jam SessionGroovy Grails DevJam Jam Session
Groovy Grails DevJam Jam Session
 
Practical Groovy DSL
Practical Groovy DSLPractical Groovy DSL
Practical Groovy DSL
 
Embedding Groovy in a Java Application
Embedding Groovy in a Java ApplicationEmbedding Groovy in a Java Application
Embedding Groovy in a Java Application
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy
 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)
 
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
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
 
groovy rules
groovy rulesgroovy rules
groovy rules
 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!
 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
 
OpenLogic
OpenLogicOpenLogic
OpenLogic
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transforms
 
tictactoe groovy
tictactoe groovytictactoe groovy
tictactoe groovy
 
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?
 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To Groovy
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
 
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
 
Дмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI векеДмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI веке
 

Viewers also liked

Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010The Chazin Group LLC
 
GR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf
 
Pencernaan Daninurriyadi
Pencernaan DaninurriyadiPencernaan Daninurriyadi
Pencernaan Daninurriyadiguest8ced8a
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf
 

Viewers also liked (7)

Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010
 
Sales Marketing Tandem
Sales Marketing TandemSales Marketing Tandem
Sales Marketing Tandem
 
GR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL Support
 
School Prep Hhs 07 Oct09
School Prep Hhs 07 Oct09School Prep Hhs 07 Oct09
School Prep Hhs 07 Oct09
 
Pencernaan Daninurriyadi
Pencernaan DaninurriyadiPencernaan Daninurriyadi
Pencernaan Daninurriyadi
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM Optimization
 

Similar to GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge

Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersKostas Saidis
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
 
Introduction to Grails
Introduction to Grails Introduction to Grails
Introduction to Grails Avi Perez
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Using the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentUsing the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentSchalk Cronjé
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails IntroductionEric Weimer
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemKostas Saidis
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsAzul Systems, Inc.
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyAndres Almiray
 
What is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionWhat is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionIgalia
 

Similar to GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge (20)

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
 
Whats New In Groovy 1.6?
Whats New In Groovy 1.6?Whats New In Groovy 1.6?
Whats New In Groovy 1.6?
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 
Introduction to Grails
Introduction to Grails Introduction to Grails
Introduction to Grails
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
Using the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentUsing the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM Development
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails Introduction
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystem
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
 
Whats New In Groovy 1.6?
Whats New In Groovy 1.6?Whats New In Groovy 1.6?
Whats New In Groovy 1.6?
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
Groovy.pptx
Groovy.pptxGroovy.pptx
Groovy.pptx
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with Groovy
 
What is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionWhat is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 edition
 

More from GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsGR8Conf
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 

More from GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

GR8Conf 2009: What's New in Groovy 1.6? by Guillaume Laforge

  • 1.
  • 2. What’s new in Groovy 1.6? Get started with Groovy and learn about all the novelties in the latest release Guillaume Laforge Head of Groovy Development
  • 3. Guillaume Laforge Groovy Project Manager — SpringSource > Working on Groovy since 2003 > JSR-241 Spec Lead > Initiator of the Grails web framework > Co-author of Groovy in Action > Speaker: JavaOne, QCon, JavaPolis/Devoxx, JavaZone, Sun Tech Days, SpringOne/The Spring Experience, JAX, DSL DevCon, and more… 3
  • 4. What’s new in Groovy 1.6? Article Published by InfoQ > This presentation was prepared with the examples I’ve used in my article written for InfoQ > http://www.infoq.com/articles/groovy-1-6 > Read this article for more detailed explanations of all the new features in Groovy 1.6 4
  • 5. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 5
  • 6. Groovy in a Nutshell Simplify the Life of Java Developers > Groovy is a dynamic language for the JVM  With a Meta-Object Protocol  Compiles down to bytecode > Open Source Apache licensed project > Relaxed grammar derived from the Java 5 grammar  Borrowed some good ideas from Smalltalk/Python/Ruby  Java 5 features out of the box:  annotations, generics, static imports, enums…  Flat learning curve 6
  • 7. A Taste of Groovy — Take 1 A Normal Java Program > public class HelloWorld { private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public String greet() { return "Hello " + name; } public static void main(String[] args) { HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println( helloWorld.greet() ); } } 7
  • 8. A Taste of Groovy — Take 2 A Normal Groovy Program > public class HelloWorld { private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public String greet() { return "Hello " + name; } public static void main(String[] args) { HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println( helloWorld.greet() ); } } 8
  • 9. A Taste of Groovy — Take 3 A Groovier Program > class HelloWorld { String name String greet() { "Hello $name" } } def helloWorld = new HelloWorld(name: "Groovy") println helloWorld.greet() 9
  • 10. The Groovy Web Console A Groovy Playground > Groovy works nicely on Google App Engine  You can also deploy Grails applications > You can play with Groovy in the web console  http://groovyconsole.appspot.com/ 10
  • 11. The Groovy Web Console A Screenshot 11
  • 12. Features at a Glance > Fully Object-Oriented > Joint compiler: seamless Java integration > Closures: reusable blocks of code / anon functions > Properties: forget about getters and setters > Optional typing: your choice! > BigDecimal arithmetic by default for floating point > Handy APIs  XML, JDBC, JMX, template engine, Swing UIs > Strong ability for authoring Domain-Specific Languages  Syntax-level “builders”  Adding properties to numbers: 10.dollars  Operator overloading: 10.meters + 20.kilometers 12
  • 13. Joint Compilation • Total Java interoperability • Concretely, what does it mean? JInterface GInterface <<implements>> <<implements>> GClass JClass JClass GClass 13
  • 14. Native Syntax Constructs • Lists – def numbers = [1, 2, 3, 4, 5] • Maps – def map = [FR: ‘France’, BE: ‘Belgium’] • Ranges – def allowed = 18..65 • Regular expressions – def whitespace = ~/s+?/ – if (‘foo’ ==~ /o+/) { ... } 14
  • 15. GStrings! • GStrings are... interpolated strings – Sorry, not really what you expected! – Placeholder variables are replaced – You can have multiline strings • def person = ‘John’ def letter = “““${new Date()} Dear ${person}, I hope you’re fine! ””” 15
  • 16. Closures • Closures are reusable and assignable code blocks or anonymous functions – No need to wait for Java 7/8/9 to get them! – def greet = { println “Hello ${it}” } greet(“Guillaume”) • You can pass parameters – def greet = { String name -> println “Hello ${name}” } • You can passe closures around – def method(Closure c) { c(“Hello”) } method(greet) 16
  • 17. BigDecimal Arithmetic • Main reason why financial institutions often decide to use Groovy for their business rules! – Although these days rounding issues are overrated! • Java vs Groovy for a simple interpolation equation • BigDecimal uMinusv = c.subtract(a); BigDecimal vMinusl = b.subtract(c); BigDecimal uMinusl = a.subtract(b); return e.multiply(uMinusv) .add(d.multiply(vMinusl)) .divide(uMinusl, 10, BigDecimal.ROUND_HALF_UP); • (d * (b - c) + e * (c - a)) / (a - b) 17
  • 18. Groovy Builders • The Markup builder – Easy way for creating XML or HTML content – def mkp = new MarkupBuilder() mkp.html { head { title “Groovy in Action” } body { div(width: ‘100’) { p(class: ‘para’) { span “Best book ever!” } } } } 18
  • 19. Parsing XML • And it’s so easy to parser XML and navigate through the node graph! • def geocodingUrl = "http://...".toURL() geocodingUrl.withInputStream { stream -> def node = new XmlSlurper().parse(stream) if (node.Response.Status.code == "200") { def text = node.Response.Placemark. Point.coordinates.text() def coord = text.tokenize(','). collect{ Float.parseFloat(it) } (latitude, longitude) = coord[1..0] } } 19
  • 20. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 20
  • 21. Performance Improvements Both Runtime & Compile-Time > The Groovyc compiler is 3x to 5x faster  With a clever class lookup cache > Certain online micro-benchmarks show 150% to 460% increase in performance compared to Groovy 1.5  Thanks to advanced call-site caching techniques  Beware of micro-benchmarks! > Makes Groovy one of the fastest dynamic languages available 21
  • 22. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 22
  • 23. Multiple Assignment Assign Multiple Variables at Once > Newly defined variables  def (a, b) = [1, 2] assert a == 1 assert b == 2 > Assign to existing variables  def lat, lng (lat, lng) = geocode(‘Paris’) > The classical swap case  (a, b) = [b, a] > Extra elements ⇒ not assigned to any variable > Less elements ⇒ null into extra variables 23
  • 24. More Optional Return In if/else and try/catch Blocks > The return keyword is optional for the last expression of a method body  But if/else & try/catch didn’t return any value > def method() { if (true) 1 else 0 } assert method() == 1 > def method(bool) { try { if (bool) throw new Exception("foo") 1 } catch(e) { 2 } finally { 3 } } assert method(false) == 1 assert method(true) == 2 24
  • 25. Annotation Definition The Missing Bit of Java 5 Support > Groovy support for Java 5 features is now complete with the missing annotation definition > Nothing to show here, it’s just normal Java :-) > Note that the sole dynamic language supporting annotation is… Groovy  Opens the door to EJB3 / JPA / Spring annotations / Guice / TestNG… 25
  • 26. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 26
  • 27. Meta-What? Meta-Programming > The ability of a language to modify itself > Groovy 1.6 introduces AST Transformations  Abstract Syntax Tree > Goodbye to a lot of boiler-plate technical code! > Two kinds of transformations  Global transformations  Local transformations: triggered by annotations 27
  • 28. AST Transformations in 1.6 Implement Patterns through Transformations > Several transformations find their way in Groovy 1.6  @Singleton — okay, not really a pattern ;-)  @Immutable, @Lazy, @Delegate  @Newify  @Category and @Mixin  @PackageScope  Swing’s @Bindable and @Vetoable  Grape’s @Grab > Let’s have a look at some of them! 28
  • 29. @Singleton (Anti-)Pattern Revisited > The evil Java singleton  public class Evil { public static final Evil instance = new Evil (); private Evil () {} Evil getInstance() { return instance; } } > In Groovy:  @Singleton class Evil {} > There’s also a « lazy » version  @Singleton(lazy = true) class Evil {} 29
  • 30. @Immutable The Immutable… Boiler-Plate Code > To properly implement immutable classes  No mutators (state musn’t change)  Private final fields  Defensive copying of mutable components  Proper equals() / hashCode() / toString() for comparisons or for keys in maps, etc. > In Groovy  @Immutable final 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 30
  • 31. @Lazy Not Just for Lazy Dudes! > When you need to lazy evaluate / instantiate complex data structures for class fields, mark them as @Lazy  class Dude { @Lazy pets = retriveFromSlowDB() } > Groovy will handle the boiler-plate code for you 31
  • 32. @Delegate Not Just for Managers! > You can delegate to fields of your class  Think multiple inheritance  class Employee { def doTheWork() { "done" } } class Manager { @Delegate Employee slave = new Employee() } def god = new Manager() assert god.doTheWork() == "done" > Damn manager who will get all the praise… 32
  • 33. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 33
  • 34. Grab a Grape Groovy Advanced Packaging Engine > Helps you distribute scripts without dependencies > Just declare your dependencies with @Grab  Will look for dependencies in Maven or Ivy repositories > @Grab(group = 'org.mortbay.jetty', module = 'jetty-embedded', version = '6.1.0') def startServer() { def srv = new Server(8080) def ctx = new Context(srv , "/", SESSIONS) ctx.resourceBase = "." ctx.addServlet(GroovyServlet, "*.groovy") srv.start() } 34
  • 35. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 35
  • 36. @Bindable (1/2) Event-Driven Made Easy > Speaking of boiler-plate code… property change listeners > import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeListener; public class MyBean { private String prop; PropertyChangeSupport pcs = new PropertyChangeSupport(this); public void addPropertyChangeListener(PropertyChangeListener l) { pcs.add(l); } public void removePropertyChangeListener(PropertyChangeListener l) { pcs.remove(l); } public String getProp() { return prop; } public void setProp(String prop) { pcs.firePropertyChanged("prop", this.prop, this.prop = prop); } } 36
  • 37. @Bindable (2/2) Event-Driven Made Easy > Groovy’s solution  class MyBean { @Bindable String prop } > Interesting in Griffon and Swing builder  textField text: bind { myBean.prop } > Also of interest: @Vetoable 37
  • 38. Griffon The Swing MVC Framework > Leverages Groovy’s SwingBuilder and Grails’ infrastructure  http://griffon.codehaus.org 38
  • 39. Swing Console Improvements > The console can be run as an applet > Code indentation support > Script drag’n drop > Add JARs in the classpath from the GUI > Execution results visualization plugin > Clickable stacktraces and error messages > Not intended to be a full-blown IDE, but handy 39
  • 40. 40
  • 41. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 41
  • 42. ExpandoMetaClass DSL Less Repetition > EMC is a way to change the behavior of types at runtime > Before  Number.metaClass.multiply = { Amount amount -> amount.times(delegate) } Number.metaClass.div = { Amount amount -> amount.inverse().times(delegate) } > Now in Groovy 1.6  Number.metaClass { multiply { Amount amount -> amount.times(delegate) } div { Amount amount -> amount.inverse().times(delegate) } } 42
  • 43. Runtime Mixins Inject New Behavior to Types at Runtime > 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!" 43
  • 44. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 44
  • 45. javax.script.* Scripting APIs Groovy Scripting Engine Built-In > The JSR-223 / javax.script.* scripting engine for Groovy is bundled in Groovy 1.6  import javax.script.* def manager = new ScriptEngineManager() def engine = manager.getEngineByName("groovy") assert engine.evaluate("2 + 3") == 5 > To evaluate Groovy scripts at runtime in your application, just drop the Groovy JAR in your classpath! 45
  • 46. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 46
  • 47. JMX Builder (1/2) Domain-Specific Language for JMX • Simplify JMX handling with a Builder pattern approach • Declaratively expose Java/Groovy objects as MBeans • JMX's event model support –Inline closures to create event handler & broadcaster –Closures for receiving event notifications • Provides a flexible registration policy for MBean • Exposes attribute, constructors, operations, parameters, and notifications • Simplified creation of connector servers & clients • Support for exporting JMX timers • http://groovy.codehaus.org/Groovy+JmxBuilder 47
  • 48. JMX Builder (2/2) Domain-Specific Language for JMX > 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: "…", from: "foo", call: { event -> …}) 48
  • 49. nda Ag e > Groovy Overview > Performance Improvements > Syntax Enhancements > Compile-Time Metaprogramming > The Grape Module System > Swing-Related Improvements > Runtime Metaprogramming Additions > JSR-223 Scripting Engine Built-In > JMX Builder > OSGi Readiness 49
  • 50. OSGi Readiness > The Groovy JAR contains OSGi metadata  Can be reused in OSGi containers out-of-the-box > Tutorials on Groovy and OSGi  http://groovy.codehaus.org/OSGi+and+Groovy  Will show you how to load Groovy as a service, write, publish and consume Groovy services, and more 50
  • 52. Summary Just Remember that Groovy Rocks! :-) > Any Java developer is a Groovy developer! > Great for your next-generation general purpose programming language, as well as for admin tasks, extending apps, writing DSLs... > Groovy 1.6 provides  Important performance gains  Efficient compile-time metaprogramming hooks  New useful features (JMX, javax.script.*, etc.)  A script dependencies system  Various Swing-related improvements  Several runtime metaprogramming additions > Get it now!  http://groovy.codehaus.org/Download 52