SlideShare a Scribd company logo
1 of 24
Download to read offline
Seven Groovy usage patterns
          for Java developers

                                 Dierk König
                          dierk.koenig@canoo.com




søndag den 17. maj 2009
Welcome!

                          Dierk König
                           Canoo fellow, www.canoo.com
                           Rich Internet Applications




                           Committer to Groovy and Grails
                           Author: Groovy in Action




søndag den 17. maj 2009
The 7 usage patterns

       •    Super Glue
       •    Liquid Heart
       •    Keyhole Surgery
       •    Smart Configuration
       •    Unlimited Openness
       •    House-Elf Scripts
       •    Prototype

                                  Examples in Groovy




søndag den 17. maj 2009
#1 Super Glue

       • Build application from existing building blocks

       • Java makes perfect infrastructure:
         middleware, frameworks, widget sets, services
       • Scripting makes a flexible (agile) applikation layer:
         views und controller
       • Grails, GSP, JBoss Seam, WebWork, Struts 2 Actions,...
       • Example: combination of XML parser, Java networking
         and Swing widget set in order to build a standard RSS
         feed reader




søndag den 17. maj 2009
Super Glue example: RSS Reader
          def url   ='http://www.groovyblogs.org/feed/rss'
          def items = new XmlParser().parse(url).channel.item
          def cols = 'pubDate title description'.tokenize()

          groovy.swing.SwingBuilder.build {
            frame(id:'f', title: 'Groovy Blogs', visible:true) {
             scrollPane {
               table {
                 tableModel(list: items) {
                    cols.each { col ->
                      closureColumn header: col, read: { it[col].text() }
            }}}}}
            f.pack()
          }



søndag den 17. maj 2009
#2 Liquid Heart

       • Externalize business models

       • Given application structure in Java
       • Allow to learn about the business:
         keep entities, relations, and behaviour flexible through
         scripting
       • Usages: Spring beans, JBoss components,rule engines
         (groovyrules.dev.java.net, JSR-94), Grails,
         enterprise risk management for world-leading insurances

       • Example: calculation rules for bonus allocation


søndag den 17. maj 2009
Liquid Heart example: bonus allocation
          revenue = employee.revenue
          switch(revenue / 1000) {
               case       0..100 : return revenue * 0.04
               case 100..200 : return revenue * 0.05
               case {it > 200} : bonusClub.add(employee)
                                   return revenue * 0.06
          }


          Binding binding = new Binding();
          binding.setVariable("employee", employee);
          binding.setVariable("bonusClub", bonusClub);
          GroovyShell shell = new GroovyShell(binding);
          File script       = new File(filename);
          float bonus       = (float) shell.evaluate(script);




søndag den 17. maj 2009
#3 Keyhole Surgery

       • Minimal-invasive surgery "in vivo"

       • Lots of need for runtime inspection
         and modifications
       • Ad-hoc queries are not foreseeable
       • "Backdoor" for the live execution of scripts
       • Particularly useful for
         product support, failure analysis, hot fixes, emergencies
       • Usages: Oracle JMX Beans, XWiki, SnipSnap, Ant, Canoo
         WebTest, Grails Console, GAE, ULC Admin Console
       • Example: a live Groovy Servlet



søndag den 17. maj 2009
Surgery through a Servlet keyhole

         Problems with the database connection?

          def ds = Config.dataSource
          ds.connection = new DebugConnection(ds.connection)




         Remove malicious users from the servlet context

          users = servletContext.getAttribute('users')
          bad = users.findAll { user -> user.cart.items.any { it.price < 0 } }
          servletContext.setAttribute('users', users - bad)




søndag den 17. maj 2009
#4 Smart Configuration

       • Enhance configuration with logic

       • Replace dumb XML configs
       • Use references, loops, conditionals, inheritance, execution
         logic, runtime environment adaption, ...
       • Typical scenario for domain specific languages (DSLs),
         Groovy Builder, Grails plugins, product customization,
         Groovy for OpenOffice:
         Community Innovation Program Silver Award Winner

       • Example: Navis SPARCS N4


søndag den 17. maj 2009
Smart Config example: container routing

          def ensureEvent = { change ->
               if (! event.getMostRecentEvent(change) {
                     event.postNewEvent(change)
               }
          }


          switch (event.REROUTE_CTR) {
                case 'OutboundCarrierId' :
                           ensureEvent('CHANGE_VSL')
                            break
                      case 'POD' :
                            if (! event.CHANGE_VSL) ensureEvent('CHANGE_POD')
                            break
          }




søndag den 17. maj 2009
#5 Unlimited Openness

       • Every line of code may be changed

       • It's impossible (and not desirable!)
         to design for every possible future
         requirement
       • Allow for easily changing the code
         without tedious setup for compilation
         and deployment
       • Follow the lessons of Perl, PHP, Python,...

       • Example: groovyblogs.org, PillarOne


søndag den 17. maj 2009
#6 House Elf

       • Delegate the housework

       • Build automation, continuous integration, deployment,
         installer, service monitoring, reports, statistics, automated
         documentation, functional tests, HTML scraping, Web
         remote control, XML-RPC, WebServices
       • Usages with Ant, Maven, AntBuilder, Gant, Gradle, Canoo
         WebTest, Grails scaffolding, ...

       • Examples: hooking scripts into Ant




søndag den 17. maj 2009
House Elf: musical Ant
          <groovy>
          import org.apache.tools.ant.*
          import org.jfugue.*
          project.addBuildListener(new PlayListener())
          class PlayListener implements BuildListener {
               def play = { new Player().play(new Pattern(it)) }
               void buildStarted(event)   {}
               void buildFinished(event) { }
               void messageLogged(event) { }
               void targetStarted(event) { play("D E") }
               void targetFinished(event) { play("C5maj") }
               void taskStarted(event)    {}
               void taskFinished(event)   {}
          }
          </groovy>



søndag den 17. maj 2009
House Elf: musical Ant
          <groovy>
          import org.apache.tools.ant.*
          import org.jfugue.*
          project.addBuildListener(new PlayListener())
          class PlayListener implements BuildListener {
               def play = { new Player().play(new Pattern(it)) }




               void targetStarted(event) { play("D E") }
               void targetFinished(event) { play("C5maj") }



          }
          </groovy>



søndag den 17. maj 2009
House Elf: musical Ant
          <groovy>
          import org.apache.tools.ant.*
          import org.jfugue.*



               def play = { new Player().play(new Pattern(it)) }




               void targetStarted(event) { play("D E") }
               void targetFinished(event) { play("C5maj") }


          project.addBuildListener(player as BuildListener)
          }
          </groovy>



søndag den 17. maj 2009
House Elf: musical Ant
          <groovy>
          import org.apache.tools.ant.*
          import org.jfugue.*



               def play = { new Player().play(new Pattern(it)) }



          def player = [
                          targetStarted:    { play("D E") },
                          targetFinished:   { play("C5maj") }
          ]
          project.addBuildListener(player as BuildListener)
          }
          </groovy>



søndag den 17. maj 2009
House Elf: musical Ant
          <groovy>
          import org.apache.tools.ant.*
          import org.jfugue.*


          def play        = { new Player().play(new Pattern(it)) }
          def player = [
                  targetStarted : { play "D E"     },
                  targetFinished : { play "C5maj" }
          ]
          project.addBuildListener(player as BuildListener)
          }
          </groovy>




søndag den 17. maj 2009
#7 Prototype

       • Feasibility study on the target platform

       • "Spikes" for technological or algorithmic ideas with more
         expressiveness, quicker feedback, and enhanced analysis
         capabilities
       • Later port to Java is optional
       • Usages: early user feedback about the domain model
         through a functional Grails prototype,
         algorithms for image manipulation

       • Example: prime number disassembly


søndag den 17. maj 2009
Prototype example: prime numbers
          boolean isPrime(x) { return ! (2..<x).any { y -> x % y == 0 } }


          int primeBelow(x) { (x..1).find { isPrime(it) } }


          List primeFactors(x) {
               if (isPrime(x)) return [x]
               int p = primeBelow(x)
               while (p > 1) {
                     if (x % p == 0) return [p, *primeFactors(x.intdiv(p))]
                     p = primeBelow(p-1)
               }
          }


          for (n in 100..110) { println "$n : "+primeFactors(n)}



søndag den 17. maj 2009
Prime numbers: counting modulo ops
          class ModCountCategory {
               static int count = 0
               static int mod(Integer self, Integer argument) {
                     count++
                     return self - argument * self.intdiv(argument)
          } }


          use (ModCountCategory) {
               for (n in 1000..1010) {
                     ModCountCategory.count = 0
                     factors = primeFactors(n)
                     println "$n : $factors".padRight(30) + "(in " +
                            "${ModCountCategory.count}".padLeft(5) + " steps)"
                     assert n == factors.inject(1){result, item -> result *= item }
          }      }



søndag den 17. maj 2009
Pattern Summary

       •    Super Glue
       •    Liquid Heart
       •    Keyhole Surgery
       •    Smart Configuration
       •    Unlimited Openness
       •    House-Elf Scripts
       •    Prototype



                                  Keep groovin' !



søndag den 17. maj 2009
More
        Information

       • Groovy in Action groovy.canoo.com/gina
         Manning, 2007, Foreword by James Gosling
         König mit Glover, Laforge, King, Skeet
       • groovy.codehaus.org, grails.org
         groovyblogs.org, searchgroovy.org




søndag den 17. maj 2009
Questions?

           More patterns in the pipeline:

           Lipstick
           - API enhancements
           Ghost
           - generating invisible code

           <your suggestion here>




søndag den 17. maj 2009

More Related Content

What's hot

Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinNelson Glauber Leal
 
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Tzung-Bi Shih
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbikailan
 
Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Yoshifumi Kawai
 
Aplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & JetpackAplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & JetpackNelson Glauber Leal
 
UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)Yoshifumi Kawai
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript EverywherePascal Rettig
 
閒聊Python應用在game server的開發
閒聊Python應用在game server的開發閒聊Python應用在game server的開發
閒聊Python應用在game server的開發Eric Chen
 
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 AdvancedEspeo Software
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}.toster
 
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015Jeongkyu Shin
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!Brendan Eich
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Takayuki Shimizukawa
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleSaúl Ibarra Corretgé
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....Alessandro Cinelli (cirpo)
 

What's hot (20)

Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com Kotlin
 
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
 
Node.js extensions in C++
Node.js extensions in C++Node.js extensions in C++
Node.js extensions in C++
 
New Design of OneRing
New Design of OneRingNew Design of OneRing
New Design of OneRing
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodb
 
Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)
 
Aplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & JetpackAplicações assíncronas no Android com Coroutines & Jetpack
Aplicações assíncronas no Android com Coroutines & Jetpack
 
UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
閒聊Python應用在game server的開發
閒聊Python應用在game server的開發閒聊Python應用在game server的開發
閒聊Python應用在game server的開發
 
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
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}
 
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Implementing New Web
Implementing New WebImplementing New Web
Implementing New Web
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
 

Viewers also liked

Social media and QR Code promo - Do not feel shy
Social media and QR Code promo - Do not feel shySocial media and QR Code promo - Do not feel shy
Social media and QR Code promo - Do not feel shyJyotindra Zaveri
 
Jiří Knesl - Techniky paralelního programování pro 21. století
Jiří Knesl - Techniky paralelního programování pro 21. stoletíJiří Knesl - Techniky paralelního programování pro 21. století
Jiří Knesl - Techniky paralelního programování pro 21. stoletíDevelcz
 
Envecon One Stop IT Solution for Maritime and Asset Intensive Industry
Envecon One Stop IT Solution for Maritime and Asset Intensive IndustryEnvecon One Stop IT Solution for Maritime and Asset Intensive Industry
Envecon One Stop IT Solution for Maritime and Asset Intensive Industryenveconit
 
12 tips for successful implementation of erp in a manufacturing company
12 tips for successful implementation of erp in a manufacturing company12 tips for successful implementation of erp in a manufacturing company
12 tips for successful implementation of erp in a manufacturing companyMRPeasy
 
ERP Goal Setting & TCO
ERP Goal Setting & TCOERP Goal Setting & TCO
ERP Goal Setting & TCOvelcomerp
 
ERP Pre-Implementation TCO Total Cost of Ownership
ERP Pre-Implementation TCO Total Cost of Ownership ERP Pre-Implementation TCO Total Cost of Ownership
ERP Pre-Implementation TCO Total Cost of Ownership Jyotindra Zaveri
 
Moving To New AVEVA Technology
Moving To New AVEVA TechnologyMoving To New AVEVA Technology
Moving To New AVEVA TechnologyAVEVA Group plc
 
Integrated Engineering Deployment in a New Engineering Office
Integrated Engineering Deployment in a New Engineering OfficeIntegrated Engineering Deployment in a New Engineering Office
Integrated Engineering Deployment in a New Engineering OfficeAVEVA Group plc
 

Viewers also liked (9)

Social media and QR Code promo - Do not feel shy
Social media and QR Code promo - Do not feel shySocial media and QR Code promo - Do not feel shy
Social media and QR Code promo - Do not feel shy
 
Jiří Knesl - Techniky paralelního programování pro 21. století
Jiří Knesl - Techniky paralelního programování pro 21. stoletíJiří Knesl - Techniky paralelního programování pro 21. století
Jiří Knesl - Techniky paralelního programování pro 21. století
 
Envecon One Stop IT Solution for Maritime and Asset Intensive Industry
Envecon One Stop IT Solution for Maritime and Asset Intensive IndustryEnvecon One Stop IT Solution for Maritime and Asset Intensive Industry
Envecon One Stop IT Solution for Maritime and Asset Intensive Industry
 
Full Cost White Paper
Full Cost White PaperFull Cost White Paper
Full Cost White Paper
 
12 tips for successful implementation of erp in a manufacturing company
12 tips for successful implementation of erp in a manufacturing company12 tips for successful implementation of erp in a manufacturing company
12 tips for successful implementation of erp in a manufacturing company
 
ERP Goal Setting & TCO
ERP Goal Setting & TCOERP Goal Setting & TCO
ERP Goal Setting & TCO
 
ERP Pre-Implementation TCO Total Cost of Ownership
ERP Pre-Implementation TCO Total Cost of Ownership ERP Pre-Implementation TCO Total Cost of Ownership
ERP Pre-Implementation TCO Total Cost of Ownership
 
Moving To New AVEVA Technology
Moving To New AVEVA TechnologyMoving To New AVEVA Technology
Moving To New AVEVA Technology
 
Integrated Engineering Deployment in a New Engineering Office
Integrated Engineering Deployment in a New Engineering OfficeIntegrated Engineering Deployment in a New Engineering Office
Integrated Engineering Deployment in a New Engineering Office
 

Similar to Seven Groovy usage patterns for Java developers

Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
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
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and ContainersRodolfo Carvalho
 
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 LaforgeGR8Conf
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)Igalia
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebMikel Torres Ugarte
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP TestingRan Mizrahi
 
ECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverMongoDB
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy PluginsPaul King
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 
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
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsOWASP Kyiv
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Codemotion
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
 

Similar to Seven Groovy usage patterns for Java developers (20)

Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
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
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
 
ECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverECMAScript 6 and the Node Driver
ECMAScript 6 and the Node Driver
 
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?
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Node azure
Node azureNode azure
Node azure
 
Job DSL Plugin for Jenkins
Job DSL Plugin for JenkinsJob DSL Plugin for Jenkins
Job DSL Plugin for Jenkins
 
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
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tips
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 

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

Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
 
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtS
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtSHot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtS
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtSApsara Of India
 
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...anamikaraghav4
 
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceVIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceApsara Of India
 
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7Riya Pathan
 
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashik
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service NashikCall Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashik
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashikranjana rawat
 
fmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsfmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsa18205752
 
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEGV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEApsara Of India
 
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any Time
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any TimeCall Girls Somajiguda Sarani 7001305949 all area service COD available Any Time
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any Timedelhimodelshub1
 
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...Amil Baba Company
 
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...srsj9000
 
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Meanamikaraghav4
 
Udaipur Call Girls 9602870969 Call Girl in Udaipur Rajasthan
Udaipur Call Girls 9602870969 Call Girl in Udaipur RajasthanUdaipur Call Girls 9602870969 Call Girl in Udaipur Rajasthan
Udaipur Call Girls 9602870969 Call Girl in Udaipur RajasthanApsara Of India
 
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcE
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcEViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcE
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcEApsara Of India
 
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal Escorts
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal EscortsCall Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal Escorts
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal EscortsApsara Of India
 
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment Booking
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment BookingAir-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment Booking
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment BookingRiya Pathan
 
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7Riya Pathan
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Riya Pathan
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...Apsara Of India
 
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...Amil Baba Company
 

Recently uploaded (20)

Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
 
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtS
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtSHot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtS
Hot Call Girls In Goa 7028418221 Call Girls In Vagator Beach EsCoRtS
 
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
 
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceVIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
 
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bagbazar 👉 8250192130 ❣️💯 Available With Room 24×7
 
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashik
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service NashikCall Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashik
Call Girls in Nashik Bhavna 7001305949 Independent Escort Service Nashik
 
fmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsfmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the hearts
 
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEGV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
 
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any Time
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any TimeCall Girls Somajiguda Sarani 7001305949 all area service COD available Any Time
Call Girls Somajiguda Sarani 7001305949 all area service COD available Any Time
 
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...
Amil baba in Pakistan amil baba Karachi amil baba in pakistan amil baba in la...
 
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
 
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
 
Udaipur Call Girls 9602870969 Call Girl in Udaipur Rajasthan
Udaipur Call Girls 9602870969 Call Girl in Udaipur RajasthanUdaipur Call Girls 9602870969 Call Girl in Udaipur Rajasthan
Udaipur Call Girls 9602870969 Call Girl in Udaipur Rajasthan
 
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcE
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcEViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcE
ViP Call Girls In Udaipur 9602870969 Gulab Bagh Escorts SeRvIcE
 
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal Escorts
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal EscortsCall Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal Escorts
Call Girls In Karnal O8860008073 Sector 6 7 8 9 Karnal Escorts
 
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment Booking
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment BookingAir-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment Booking
Air-Hostess Call Girls Shobhabazar | 8250192130 At Low Cost Cash Payment Booking
 
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Bara Bazar 👉 8250192130 ❣️💯 Available With Room 24×7
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
 
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...
Amil Baba in Pakistan Kala jadu Expert Amil baba Black magic Specialist in Is...
 

Seven Groovy usage patterns for Java developers

  • 1. Seven Groovy usage patterns for Java developers Dierk König dierk.koenig@canoo.com søndag den 17. maj 2009
  • 2. Welcome! Dierk König Canoo fellow, www.canoo.com Rich Internet Applications Committer to Groovy and Grails Author: Groovy in Action søndag den 17. maj 2009
  • 3. The 7 usage patterns • Super Glue • Liquid Heart • Keyhole Surgery • Smart Configuration • Unlimited Openness • House-Elf Scripts • Prototype Examples in Groovy søndag den 17. maj 2009
  • 4. #1 Super Glue • Build application from existing building blocks • Java makes perfect infrastructure: middleware, frameworks, widget sets, services • Scripting makes a flexible (agile) applikation layer: views und controller • Grails, GSP, JBoss Seam, WebWork, Struts 2 Actions,... • Example: combination of XML parser, Java networking and Swing widget set in order to build a standard RSS feed reader søndag den 17. maj 2009
  • 5. Super Glue example: RSS Reader def url ='http://www.groovyblogs.org/feed/rss' def items = new XmlParser().parse(url).channel.item def cols = 'pubDate title description'.tokenize() groovy.swing.SwingBuilder.build { frame(id:'f', title: 'Groovy Blogs', visible:true) { scrollPane { table { tableModel(list: items) { cols.each { col -> closureColumn header: col, read: { it[col].text() } }}}}} f.pack() } søndag den 17. maj 2009
  • 6. #2 Liquid Heart • Externalize business models • Given application structure in Java • Allow to learn about the business: keep entities, relations, and behaviour flexible through scripting • Usages: Spring beans, JBoss components,rule engines (groovyrules.dev.java.net, JSR-94), Grails, enterprise risk management for world-leading insurances • Example: calculation rules for bonus allocation søndag den 17. maj 2009
  • 7. Liquid Heart example: bonus allocation revenue = employee.revenue switch(revenue / 1000) { case 0..100 : return revenue * 0.04 case 100..200 : return revenue * 0.05 case {it > 200} : bonusClub.add(employee) return revenue * 0.06 } Binding binding = new Binding(); binding.setVariable("employee", employee); binding.setVariable("bonusClub", bonusClub); GroovyShell shell = new GroovyShell(binding); File script = new File(filename); float bonus = (float) shell.evaluate(script); søndag den 17. maj 2009
  • 8. #3 Keyhole Surgery • Minimal-invasive surgery "in vivo" • Lots of need for runtime inspection and modifications • Ad-hoc queries are not foreseeable • "Backdoor" for the live execution of scripts • Particularly useful for product support, failure analysis, hot fixes, emergencies • Usages: Oracle JMX Beans, XWiki, SnipSnap, Ant, Canoo WebTest, Grails Console, GAE, ULC Admin Console • Example: a live Groovy Servlet søndag den 17. maj 2009
  • 9. Surgery through a Servlet keyhole Problems with the database connection? def ds = Config.dataSource ds.connection = new DebugConnection(ds.connection) Remove malicious users from the servlet context users = servletContext.getAttribute('users') bad = users.findAll { user -> user.cart.items.any { it.price < 0 } } servletContext.setAttribute('users', users - bad) søndag den 17. maj 2009
  • 10. #4 Smart Configuration • Enhance configuration with logic • Replace dumb XML configs • Use references, loops, conditionals, inheritance, execution logic, runtime environment adaption, ... • Typical scenario for domain specific languages (DSLs), Groovy Builder, Grails plugins, product customization, Groovy for OpenOffice: Community Innovation Program Silver Award Winner • Example: Navis SPARCS N4 søndag den 17. maj 2009
  • 11. Smart Config example: container routing def ensureEvent = { change -> if (! event.getMostRecentEvent(change) { event.postNewEvent(change) } } switch (event.REROUTE_CTR) { case 'OutboundCarrierId' : ensureEvent('CHANGE_VSL') break case 'POD' : if (! event.CHANGE_VSL) ensureEvent('CHANGE_POD') break } søndag den 17. maj 2009
  • 12. #5 Unlimited Openness • Every line of code may be changed • It's impossible (and not desirable!) to design for every possible future requirement • Allow for easily changing the code without tedious setup for compilation and deployment • Follow the lessons of Perl, PHP, Python,... • Example: groovyblogs.org, PillarOne søndag den 17. maj 2009
  • 13. #6 House Elf • Delegate the housework • Build automation, continuous integration, deployment, installer, service monitoring, reports, statistics, automated documentation, functional tests, HTML scraping, Web remote control, XML-RPC, WebServices • Usages with Ant, Maven, AntBuilder, Gant, Gradle, Canoo WebTest, Grails scaffolding, ... • Examples: hooking scripts into Ant søndag den 17. maj 2009
  • 14. House Elf: musical Ant <groovy> import org.apache.tools.ant.* import org.jfugue.* project.addBuildListener(new PlayListener()) class PlayListener implements BuildListener { def play = { new Player().play(new Pattern(it)) } void buildStarted(event) {} void buildFinished(event) { } void messageLogged(event) { } void targetStarted(event) { play("D E") } void targetFinished(event) { play("C5maj") } void taskStarted(event) {} void taskFinished(event) {} } </groovy> søndag den 17. maj 2009
  • 15. House Elf: musical Ant <groovy> import org.apache.tools.ant.* import org.jfugue.* project.addBuildListener(new PlayListener()) class PlayListener implements BuildListener { def play = { new Player().play(new Pattern(it)) } void targetStarted(event) { play("D E") } void targetFinished(event) { play("C5maj") } } </groovy> søndag den 17. maj 2009
  • 16. House Elf: musical Ant <groovy> import org.apache.tools.ant.* import org.jfugue.* def play = { new Player().play(new Pattern(it)) } void targetStarted(event) { play("D E") } void targetFinished(event) { play("C5maj") } project.addBuildListener(player as BuildListener) } </groovy> søndag den 17. maj 2009
  • 17. House Elf: musical Ant <groovy> import org.apache.tools.ant.* import org.jfugue.* def play = { new Player().play(new Pattern(it)) } def player = [ targetStarted: { play("D E") }, targetFinished: { play("C5maj") } ] project.addBuildListener(player as BuildListener) } </groovy> søndag den 17. maj 2009
  • 18. House Elf: musical Ant <groovy> import org.apache.tools.ant.* import org.jfugue.* def play = { new Player().play(new Pattern(it)) } def player = [ targetStarted : { play "D E" }, targetFinished : { play "C5maj" } ] project.addBuildListener(player as BuildListener) } </groovy> søndag den 17. maj 2009
  • 19. #7 Prototype • Feasibility study on the target platform • "Spikes" for technological or algorithmic ideas with more expressiveness, quicker feedback, and enhanced analysis capabilities • Later port to Java is optional • Usages: early user feedback about the domain model through a functional Grails prototype, algorithms for image manipulation • Example: prime number disassembly søndag den 17. maj 2009
  • 20. Prototype example: prime numbers boolean isPrime(x) { return ! (2..<x).any { y -> x % y == 0 } } int primeBelow(x) { (x..1).find { isPrime(it) } } List primeFactors(x) { if (isPrime(x)) return [x] int p = primeBelow(x) while (p > 1) { if (x % p == 0) return [p, *primeFactors(x.intdiv(p))] p = primeBelow(p-1) } } for (n in 100..110) { println "$n : "+primeFactors(n)} søndag den 17. maj 2009
  • 21. Prime numbers: counting modulo ops class ModCountCategory { static int count = 0 static int mod(Integer self, Integer argument) { count++ return self - argument * self.intdiv(argument) } } use (ModCountCategory) { for (n in 1000..1010) { ModCountCategory.count = 0 factors = primeFactors(n) println "$n : $factors".padRight(30) + "(in " + "${ModCountCategory.count}".padLeft(5) + " steps)" assert n == factors.inject(1){result, item -> result *= item } } } søndag den 17. maj 2009
  • 22. Pattern Summary • Super Glue • Liquid Heart • Keyhole Surgery • Smart Configuration • Unlimited Openness • House-Elf Scripts • Prototype Keep groovin' ! søndag den 17. maj 2009
  • 23. More Information • Groovy in Action groovy.canoo.com/gina Manning, 2007, Foreword by James Gosling König mit Glover, Laforge, King, Skeet • groovy.codehaus.org, grails.org groovyblogs.org, searchgroovy.org søndag den 17. maj 2009
  • 24. Questions? More patterns in the pipeline: Lipstick - API enhancements Ghost - generating invisible code <your suggestion here> søndag den 17. maj 2009