wecode il: confessions of a java developer that fell in love with the groovy language

34
Why every Java developer should know Groovy language Victor Trakhtenberg [email protected] @victortr75

Upload: victor-trakhtenberg

Post on 07-Aug-2015

47 views

Category:

Documents


3 download

TRANSCRIPT

Why everyJava developer

should know Groovy language

Victor Trakhtenberg

[email protected] @victortr75

Personal

My name is Victor

Personal

Java.IL community co-founder

http://www.meetup.com/JavaIL/

Groovy is very easy to enter into for Java developers,

since…

Java code is Groovy code

Groovy Features

• Strings• Collections• Date• Parsing and producing

JSON• Working with a DB• Processing XML• Template engines

• Builders• Grapes• Traits• Processing

configuration• HTTPBuilder• and many more…

Groovy is more than just a set of features,

it is more than a better Java

There are new concepts for Java developers

• Dynamic language• with optional static-typing and static-

compilation• Closures• Functional programming• Meta-programming• Traits• DSLs • and more…

Prelude - REPL

Groovy Collections

Map with default

Personal Experience

Using Groovy in a running Java project

Our setup: Java Play! Framework project

Choose one concern to use Groovy

Our choice: JSON manipulations

Parse JSON

Build JSON

Case Study: Campaign Configuration Management

The Java interface and the Groovy implementation

Java-to-Groovy Bridge

Is it a ‘coupon’ campaign

Is it a ‘coupon’ campaign

Is it a ‘coupon’ campaign

Integrate with Salesforce

Update account at Salesforce

Integrate with Salesforce - Authenticate

Use Groovy for non-production

http://jaxenter.com/groovy-is-the-swift-alternative-for-android-107846.html

Groovy resources• http://groovy-lang.org/• http://glaforge.appspot.com/category/Groovy%20Weekly• http://www.mrhaki.com/• https://plus.google.com/communities/105160926044623621768• http://www.mscharhag.com/2015/02/creating-android-apps-with-

groovy.html• http://groovy.codehaus.org/modules/http-builder/doc/uribuilder.html• http://www.drdobbs.com/jvm/why-build-your-java-projects-with-

gradle/240168608?pgno=3• http://www.infoq.com/presentations/groovy-test-java-spock• http://www.infoq.com/presentations/testing-spock-geb• http://melix.github.io/blog/2015/02/who-is-groovy.html• http://groovy-the-superb-homeless.mally.pl/#/• https://github.com/victorgit/GroovyPresentation

MrHaki – Groovy Goodness

http://mrhaki.blogspot.co.il/2009/09/groovy-goodness-padding-strings.html

Images sources• http://www.clevercuties.com/myimages/products/Computers/IHEARTPROGRAMMING.jpg• http://blogs.perceptionsystem.com/wp-content/uploads/2013/12/Happy-Customer.jpg• http://lifepalette.com/wp-content/uploads/2015/01/Productivity.jpg• http://www.checkaction.com/blog/wp-content/uploads/2014/01/startup-employee-productivity-tips-675x320.jpg• http://www.akifarslan.com.tr/wp-content/uploads/2013/10/java.jpg• http://cdn.makeuseof.com/wp-content/uploads/2012/03/jvm.png?84ec63• http://cdn.slidesharecdn.com/ss_thumbnails/ecosystem-120717081103-phpapp01-thumbnail-4.jpg?cb=1342530724• http://www.army-armee.forces.gc.ca/assets/ARMY_Internet/images/ceremonial-guard/index-main.jpg• http://www.local-guru.net/img/guru/have_fun.png• http://blog.xo.com/wp-content/uploads/2014/03/pic-raised-hands-550x300.png• https://pbs.twimg.com/media/BVDKBfUCIAAWKw9.jpg• http://www.nscsd.org/webpages/jenkondrk/imageGallery/Clip%20art/raise%20hand.gif• http://ubik.cc/MAOW-Firenze-09/images/repl-loop.png• http://hirportal.sikerado.hu/images/kep/201110/belyeg.jpg• http://www.slideshare.net/SpringCentral/groovy-in-thelightofjava8• http://blog.cacoethes.co.uk/groovyandgrails/groovy-in-light-of-java-8• http://www.infoq.com/articles/groovy-to-Java-8• https://tedvinke.wordpress.com/2014/06/20/java-8-lambdas-vs-groovy-closures-compactness-grouping-and-summing/• http://groovy.mn/static/hh97hMrFEv8Xc9j1zvR9winGH86xmHGbiZNKFTORWYl.jpg