SlideShare a Scribd company logo
1 of 46
Confessions of a
Java developer
that fell in love with the
Groovy language
Victor Trakhtenberg
victortr75@gmail.com @victortr75
Personal
My name is Victor
Personal
Java.IL community co-founder
http://www.meetup.com/JavaIL/
Personal
Full Stack Engineer @
http://commercesciences.com/jobs
It is NOT an introduction to Groovy
It is NOT “why you should not use
Java”
It is NOT “why you must
use
Groovy”
It is “why every Java
developer
MUST KNOW
Groovy”
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
• Mixins
• DSLs
• and more…
Using Groovy
Raise your hands
Using Java
Using Ruby,Python, Scala etc.
Prelude - REPL
Groovy Collections
Map with default
http://groovy-the-superb-homeless.mally.pl/
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
Fetch campaign type
Is it a ‘coupon’ campaign
Is it a ‘coupon’ campaign
Is it a ‘coupon’ campaign
http://groovy.codehaus.org/modules/http-builder/home.html
Integrate with Salesforce
Update account at Salesforce
Integrate with Salesforce - Authenticate
URIBuilder
URIBuilder - Java
Challenges
• IDE support
– Browsing Java code – Groovy code
• Long stack traces
– challenging debugging
• Coding conventions
Use Groovy for non-production
Groovy in light of Java8
• There is still a gap between Java 8 and Groovy
• There is a synergy between Groovy and Java 8
http://www.slideshare.net/SpringCentral/groovy-in-thelightofjava8
http://www.javacodegeeks.com/2014/06/java-8-lambdas-vs-groovy-closures-compactness-grouping-and-summing.html
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/#/
• http://www.eweek.com/developer/groovy-language-proposed-as-
apache-incubator-project.html
• 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.pivotal.io/pivotal/news-2/groovy-2-4-and-grails-3-0-to-be-last-major-releases-under-pivotal-
sponsorship
• http://therealdanvega.com/blog/2015/01/20/pivotal-drops-groovy-grails-sponsorship
• http://grails.io/post/108534902333/the-future-of-groovy-grails-sponsorship
• http://groovy.mn/static/hh97hMrFEv8Xc9j1zvR9winGH86xmHGbiZNKFTORWYl.jpg

More Related Content

What's hot

Python for web development
Python for web developmentPython for web development
Python for web developmentLuis Borbon
 
Internship at CloudFactory
Internship at CloudFactoryInternship at CloudFactory
Internship at CloudFactoryKarmath Dangol
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Bibby Chung
 
Dsl로 만나는 groovy
Dsl로 만나는 groovyDsl로 만나는 groovy
Dsl로 만나는 groovySeeyoung Chang
 
Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to GoOliver N
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkFrancis Addai
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014jbandi
 
Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?jbandi
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor TurskyiJulia Cherniak
 
Bledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceBledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceOpen Labs Albania
 
Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Michal Juhas
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development WorkflowVũ Nguyễn
 
Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)jbandi
 

What's hot (15)

Python for web development
Python for web developmentPython for web development
Python for web development
 
Internship at CloudFactory
Internship at CloudFactoryInternship at CloudFactory
Internship at CloudFactory
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 
Dsl로 만나는 groovy
Dsl로 만나는 groovyDsl로 만나는 groovy
Dsl로 만나는 groovy
 
Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to Go
 
TypeScript
TypeScriptTypeScript
TypeScript
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web Framework
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
 
Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
 
Bledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceBledar Gjocaj - Java open source
Bledar Gjocaj - Java open source
 
Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)
 
From NodeJS to Rust
From NodeJS to RustFrom NodeJS to Rust
From NodeJS to Rust
 

Similar to Confessions of a java developer that fell in love with the groovy language

javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonDomingo Suarez Torres
 
Javascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumJavascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumTechday7
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxGennady Feldman
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)Alvaro Sanchez-Mariscal
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneTroy Miles
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's worldSudar Muthu
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Java Script from Browser to Server
Java Script from Browser to ServerJava Script from Browser to Server
Java Script from Browser to ServerWSO2
 
Taking Flexibility to the Next Level
Taking Flexibility to the Next LevelTaking Flexibility to the Next Level
Taking Flexibility to the Next LevelForgeRock
 
DevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebDevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebAlvaro Sanchez-Mariscal
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)Oursky
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Provectus
 
Java Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.EasyJava Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.Easyroialdaag
 
Gwt overview & getting started
Gwt overview & getting startedGwt overview & getting started
Gwt overview & getting startedBinh Bui
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013Gavin Hogan
 
Groovy best pratices at EWAY
Groovy best pratices at EWAYGroovy best pratices at EWAY
Groovy best pratices at EWAYĐào Hiệp
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsTimmy Kokke
 

Similar to Confessions of a java developer that fell in love with the groovy language (20)

javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
Javascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumJavascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to Titanium
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and Backbone
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Java Script from Browser to Server
Java Script from Browser to ServerJava Script from Browser to Server
Java Script from Browser to Server
 
Taking Flexibility to the Next Level
Taking Flexibility to the Next LevelTaking Flexibility to the Next Level
Taking Flexibility to the Next Level
 
DevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebDevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and Geb
 
Jvm
JvmJvm
Jvm
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
 
Java Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.EasyJava Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.Easy
 
Gwt overview & getting started
Gwt overview & getting startedGwt overview & getting started
Gwt overview & getting started
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013
 
Groovy best pratices at EWAY
Groovy best pratices at EWAYGroovy best pratices at EWAY
Groovy best pratices at EWAY
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Confessions of a java developer that fell in love with the groovy language

  • 1. Confessions of a Java developer that fell in love with the Groovy language Victor Trakhtenberg victortr75@gmail.com @victortr75
  • 4. Personal Full Stack Engineer @ http://commercesciences.com/jobs
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. It is NOT an introduction to Groovy It is NOT “why you should not use Java” It is NOT “why you must use Groovy”
  • 10. It is “why every Java developer MUST KNOW Groovy”
  • 11. Groovy is very easy to enter into for Java developers, since… Java code is Groovy code
  • 12. 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…
  • 13. Groovy is more than just a set of features, it is more than a better Java
  • 14. There are new concepts for Java developers • Dynamic language • with optional static-typing and static- compilation • Closures • Functional programming • Meta-programming • Mixins • DSLs • and more…
  • 15.
  • 16. Using Groovy Raise your hands Using Java Using Ruby,Python, Scala etc.
  • 19.
  • 22.
  • 23. Using Groovy in a running Java project Our setup: Java Play! Framework project Choose one concern to use Groovy Our choice: JSON manipulations
  • 26. Case Study: Campaign Configuration Management
  • 27. The Java interface and the Groovy implementation
  • 30. Is it a ‘coupon’ campaign
  • 31. Is it a ‘coupon’ campaign
  • 32. Is it a ‘coupon’ campaign
  • 34. Update account at Salesforce
  • 35. Integrate with Salesforce - Authenticate
  • 38. Challenges • IDE support – Browsing Java code – Groovy code • Long stack traces – challenging debugging • Coding conventions
  • 39. Use Groovy for non-production
  • 40. Groovy in light of Java8 • There is still a gap between Java 8 and Groovy • There is a synergy between Groovy and Java 8 http://www.slideshare.net/SpringCentral/groovy-in-thelightofjava8 http://www.javacodegeeks.com/2014/06/java-8-lambdas-vs-groovy-closures-compactness-grouping-and-summing.html
  • 42.
  • 43. 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/#/ • http://www.eweek.com/developer/groovy-language-proposed-as- apache-incubator-project.html • https://github.com/victorgit/GroovyPresentation
  • 44. MrHaki – Groovy Goodness http://mrhaki.blogspot.co.il/2009/09/groovy-goodness-padding-strings.html
  • 45.
  • 46. 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.pivotal.io/pivotal/news-2/groovy-2-4-and-grails-3-0-to-be-last-major-releases-under-pivotal- sponsorship • http://therealdanvega.com/blog/2015/01/20/pivotal-drops-groovy-grails-sponsorship • http://grails.io/post/108534902333/the-future-of-groovy-grails-sponsorship • http://groovy.mn/static/hh97hMrFEv8Xc9j1zvR9winGH86xmHGbiZNKFTORWYl.jpg

Editor's Notes

  1. שלום לכולם. כמה מילים על עצמי. קוראים לי ויקטור.
  2. אני אחד המארגנים של קהילת Java.IL יחד עם אסף, אורי, חיים ותומר אנחנו מארגנים meetups וכנסים בנושאים הקשורים ל Java JVM ושפות תיכנות JVM אנחנו פועלים כחצי שנה, יש כבר קרוב ל 650 נרשמים. אני רוצה לנצל את ההזדמנות הזאת כדי להזמין אותכם להירשם, להשתתף במיטאפים: גם לשמוע וגם לדבר, ולהיות פעילים בקהילה.
  3. בזמני החופשי מפעילות זו אני עןשה חיים ב Commerce Sciences יחד עם שאר הצוות אנחנו כובשים את עולם ה Website Personalization אנחנו מגייסים. אז אם אתם אוהבים ליצור מוצרים שלקוחות אוהבים להשתמש, דברו איתי.
  4. אני אוהב לתכנת. אחת הסיבות המרכזיות היא שאני אוהב לראות שמשתמשים במה שאני יוצר, אני אוהב שלקוחות אוהבים להשתמש במוצרים שאני יוצר. לכן חשוב לי להשתמש בכלים שעוזרים לי להיות פרודוקטיבי, כלים שעוזרים לי לגרום לדברים לקרות. שפת תיכנות היא אחד הכלים האלה.
  5. בואו נראה איך Java בתחום הזה. ה runtime של Java ה JVM הוא מערכת יציבה שקיימת כבר 20 שנה, מאד נדיר להיתקל בבאג כאן. אפשר לבנות מערכות שהן robust and scalable - תורם הרבה לפרודקטיביות. ל Java יש ecosystem מאד עשיר, כמעט כל בעיה שאתם נתקלים אפשר למצוא תשובה או לשאול…- תורם הרבה לפרודקטיביות.
  6. אבל מה לגבי שפה עצמה? כאן זה כבר פחות תורם לפרודוקטיביות. אני מפתח Java 15 שנה, אני אוהב Java, אבל ב Java צריך לכתוב הרבה boilerplate code וזה עוצר אותך, זה לא נותן להתקדם וזה ממש לא כיף. לא הרגשתם Java עוצרת אותכם? הלוואי ו Java היתה דינאמית יותר, קלילה יותר ומגניבה יותר כמו שפות אחרות אולי. לא כיף לפתח עם Java.
  7. לפני כשנתיים וחצי פגשתי את Groovy. Groovy היא שפת תיכנות מבוססת על  Java, היא רצה מעל JVM, ולכן נהנת מכל הדברים הטובים שלה. היות ואפשר להשתמש בקוד Java בתוך קוד של Groovy אפשר להנות מה ecosystem של Java, אבל Groovy מוסיפה ecosystem נוסף, ecosystem חם ומקבל מפתחים חדשים. Groovy היא שפה דינאמית וקלילה בעזרת Groovy אפשר להיות הרבה יותר פרודוקטיבי וגם להנות מהפיתוח.
  8. המצגת הזאת היא לא מבוא ל Groovy, אני לא הולך לשכנע אותכם לא להשתמש ב Java, אני לא הולך לשכנע אותכם שאתם חייבים להשתמש ב Groovy, אני הולך לשכנע אותכם שכל מפתח Java חייב לדעת Groovy.
  9. למפתח Java קל מאד להיכנס ל Groovy, קוד Java הוא קוד Groovy, בעצם כל מפתח Java הוא כבר מפתח Groovy. אפשר להתחיל בקטן, להתקדם בקצב שלך, ללמוד כל פעם feature אחד, ואז עוד ועוד.
  10. ויש הרבה features מעניינים. אני לא הולך לפרט כאן את features, יש הרבה חומר ברשת. אני אגע בקצרה בכמה בהמשך.
  11. אבל Groovy היא יותר מאוסף של features, היא יותר מ Java משופרת, Groovy חושפת את מפתחי Java ל concepts חדשים, דרכים נוספות לפתח תוכנה, וגם פותחת דרכים ללמוד שפות נוספות. אני יכול להעיד על עצמי שמאז שאני מפתח גם ב groovy אני מפתח טוב יותר גם ב Java. וגם לומד ומפתח ב scala.
  12. משתמשים ב Groovy בהרבה אירגונים גדולים ומפורסמים וקטנים. אני משתתף הרבה במיטאפים וכנסים בארץ, אני מארגן חלק מהם ואני שומע מעט מאד על Groovy. זה לא המצב בעולם, בכנסים מובילים בעולם מדברים הרבה על Groovy יש הרבה פרויקטים עם Groovy. אני חושב שהמצב בארץ לא מוצדק חבל שזה כך ואני רוצה לשנות את זה. אני חושב שיש ל Groovy יתרון על פני שפות JVM אחרות שגם הן נהנות מה runtime הזה. יש כמה שפות מצויינות אבל ל Groovy  קל מאד להיכנס בניגוד לשפות אחרות. לכן אני חושב שכל מפתח Java חייב לדעת Groovy: זה יכול להיות שימושי בהרבה מאד מקרים, זה מכניס כיף לפיתוח. אני אראה לכם כמה דוגמאות כאלה בהמשך.
  13. אני אשמח להכיר אותכם קצת. כמה מפתחי Java יש באולם הזה? Groovy? Python, Ruby, Scala?
  14. לפני שאני נוגע ב Groovy עצמו אני רוצה להראות לכם כלי מאד שימושי שמגיע עם Groovy, זהו כלי שאפשר להשתמש בו גם כשמפתחים Java. מפתחי Ruby,Python,Scala,Javascript שבינכם מכירים את המושג REPL: זוהי אותה סביבה command line בהרבה מקרים, שמאפשרת לכתוב פקודות בשפה מסויימת ומייד לראות תוצאה. זה מאד שימושי, תורם הרבה לזרימה בזמן הפיתוח. כמה נחמד לרשום קוד Javascript ב Chrome dev tool ופשוט מייד לראות תוצאה. ב Java אין משהו כזה, ואני חושב שזאת נכות של  Java. אבל עכשיו בזכות ה groovy shell יש את זה גם ב Java!! אני אראה לכם. אני קיבלתי ממקור חיצוני URL אבל הוא היה escaped חיפשתי באינטרנט ומצאתי שיש API של apache commons lang שמאפשר לעשות unescape בדרך כלל ב Java צריך לייצר איזשהו main או unit test no more!!!! אפשר לעשות את זה גם מ IDE הנה כך ב intellij
  15. אחד הדברים הראשונים שאני למדתי לאהוב ב Groovy הן Groovy collections הן מתבססות על Java collections אבל מוסיפות כל כך הרבה יכולות! הנה כך מאתחלים רשימה שהיא בעצם ה ArrayList של Java קל מאד לקחת רשימה ולהפוך אותה לרשימה אחרת
  16. איך מאתחלים map עם ערכים התחלתיים וערך default שורה אחת ב Groovy וכך עושים את זה ב  Java
  17. ב Commerce Sciences אנחנו מפתחים מוצר שה front end שלו היא single page application המפותח מעל Ember וה- backend אפליקציית Java מעל Play! Framework. אנחנו מנהלים campaigns של לקוחות. campaign הוא בעצם json שנשמר ב DB. חלקים מה json הזה נשלחים ל front end בפורמט ש ember מצפה לקבל. יש הרבה התעסקות עם json. אנחנו מצאנו את עצמנו מתאמצים המון לעשות את זה ב Java. ב Groovy זה כל כך פשוט, תיכף תיראו.
  18. הסיפר שלנו הוא בעצם דוגמה לשימוש ב Groovy באפלירציית Java קיימת. אנחנו התחלנו עם בעיה אחת: מניפולציות json.