confessions of a java developer that fell in love with the groovy language
TRANSCRIPT
Confessions of a Java developer
who fell in love with the Groovy language
Victor Trakhtenberg
[email protected] @victortr75
Personal
My name is Victor
Personal
Java.IL community co-founder
http://www.meetup.com/JavaIL/
Full Stack Engineer @
http://commercesciences.com/jobs
WeCode-IL
code with us!!
http://www.meetup.com/WeCode-IL/
Groovy language concepts
• Dynamic language• with optional static-typing and static-
compilation• Closures• Functional programming• Meta-programming• Traits• DSLs • and more…
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 History• 2003 – A dynamic language for the JVM (community commits
– 100%)• 2007 – Groovy 1.0• 2008 – G2One era (G2One -> SpringSource -> VMWare ->
Pivotal)• 2011 – Time to move to GitHub• 2012 – Groovy 2 and static compilation (community commits
– 63%)• 2014 – Android support • 2015 – End of Pivotal sponsorship + Apache foundation
http://melix.github.io/blog/2015/02/who-is-groovy.html
Prelude - REPL
Groovy Strings
Strings
Groovy Collections
Collections
Collections - cont.
Map with default
Groovy Date
Dates: it’s easy!!
TimeDuration + TimeCategory
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
Is it a ‘coupon’ campaign
Integrate with Salesforce
Update account at Salesforce
Integrate with Salesforce - Authenticate
Groovy SQL
DB Table to CSV
Groovy + MongoDB = gmongo
Use Groovy for non-production
Spock – Data Tables
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• https://dzone.com/articles/groovys-smooth-operators• 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• http://4.bp.blogspot.com/-eHpEiIM6Nss/VRs-EqQjzYI/AAAAAAAATSo/tpEFUn3QrZY/s1600/SQL-Server.png• http://www.kittenswhiskers.com/wp-content/uploads/sites/48/2014/02/fun-with-yarn-640x422.jpg