SlideShare a Scribd company logo
JSR 335:
                             λ
Project Lambda
François Sarradin -- Xebia
Java Roadmap
               337
 Java 7     JSR Java 8
jul. 2011      aug. 2013                    Java 9
                                              ?


              Modularity
            Performance ●     FP / Parallel comp.
             Productivity ●   Date API improv.
                          ●   Type annotation
                          ●   Compact profiles
                          ●   Nashorn
Project Lambda
What's in it?
                    Project
                    Lambda
                      JSR335


                                        Virtual Extension
Lambda Expression
                                             Method


                  Collection API         Collection API
Functional API
                 Parallel Collections    Bulk Operations
Question


     What will be the impact
        of Project Lambda
        on the Java world?
Answer
Look at Speed Car!
Planning...
Presentation + live coding (free to interrupt)

● Genesis
● Lambda of Java
● Project Lambda
...And Then
● Debate

● Retrospective (agile style!)

● Report
   ○ Xebia blog
   ○ Project Lambda ML
Genesis
More Processors
More Expressiveness
More Readability

   结果 汉字 = new 物().処理();
             vs.
  fact n = product [1..n]


           Is it all Chinese to you?
FP & Competition


    Clojure
                   C++
          C# / F#
               Guava
(Anonymous) Inner Class
A λ Solution

Iterables.filter(persons,
 new Predicate<Person>() {

  @Override
  public boolean apply(Person person) {
    return person.getAge() >= 18;
  }

}); // Java + Guava
(Anonymous) Inner Class
A (better?) λ Solution
Iterables.filter(persons, IS_ADULT);

Predicate<Person> IS_ADULT
   = new Predicate<Person>() {

  @Override
  public boolean apply(Person person) {
    return person.getAge() >= 18;
  }

});
                    This is what you really need!
(Anonymous) Inner Class
(Not Really) A λ Solution

● "The pain of anonymous inner classes makes us roll
  our eyes in the back of our heads every day." (a wise
  Oracle's client, 01/2011)



       Average length of Java one-liner is 21 line!
       @DEVOPS_BORAT - 12/09/2011
What about Oracle?


● "It’s time to add closures to Java" (Mark Reinhold,
   12/2009)

● "Oracle's position is that Java must evolve -- carefully,
   of course -- in order to remain competitive." (Brian
   Goetz - 08/2011)
Lambda of Java
Here is the λ!

(int x, int y) -> { return x + y; }
(x, y) -> { return x + y; }
(int x, int y) -> x + y


        (x, y) -> x + y
Other λ forms

x   -> 2 * x

() -> 42

m   -> {
    m.put("France", "Paris");
    m.put("UK", "London");
    m.put("USA", "Washington");
}
Inner Class
vs. λ Solution
Iterables.filter(persons,
 new Predicate<Person>() {
   @Override
   public boolean apply(Person p) {
     return p.getAge() >= 18;
   }
}); // Java 5-7 + Guava


Iterables.filter(persons, // Java 8 + Guava
     p -> p.getAge() >= 18);
Method Reference

String::valueOf
// like: v -> String.valueOf(v)

Integer::compare
// like: (i1, i2) -> Integer.compare(i1, i2)



Arrays.sort(myInts, Integer::compare)
Virtual Extension Method
    (VEM)

interface Message {

    String getMessage() default {
      return "Look Ma'! Interface with code!";
    }

}
VEM
Motivation
 VEM
                              eg. Collection API

       Help to extend existing APIs


       Minimize rewrite of existing
       API implementation

                            eg. Hibernate Collection
                            Implementation
Collection API Extended


  java.util.functions.*
  java.util.streams.*
  Extension of Iterable, Iterator, Collection, Map, ...
  java.util.Optional
Parallel Computing
As Easy as 1-2-3?

myCollection.stream()
   .filter(x -> ...)
   .map(x -> ...)
   .reduce((x, y) -> ...) // sequential


myCollection.parallel()
   .filter(x -> ...)
   .map(x -> ...)
   .reduce((x, y) -> ...) // parallel
Some kata and demos...
Project Lambda
The Dream Team ;)




                    photo: @crazybob
Web Sites

JSR335
http://jcp.org/en/jsr/detail?id=335



OpenJDK 8 Web site
http://openjdk.java.net/projects/lambda/
Where to Get Java 8


Java SE 8 Early Access (with lambda)
http://jdk8.java.net/lambda/


Mercurial repo
http://hg.openjdk.java.net/lambda/lambda
Mailing Lists
Technical Discussion
mailto:lambda-dev@openjdk.java.net
http://mail.openjdk.java.net/pipermail/lambda-dev/


Libs Spec Discussion
http://mail.openjdk.java.net/pipermail/lambda-libs-spec-<*>/


Spec Discussion
http://mail.openjdk.java.net/pipermail/lambda-spec-<*>/
Around Project Lambda

OpenJDK OSX Build (7 & 8)
http://code.google.com/p/openjdk-osx-build/

                                                             H. Gomez




Java 8 vs Scala: a Feature
Comparison
http://www.infoq.com/articles/java-8-vs-scala
                                                S. van den Berg
                                                                  U. Peter
Around Project Lambda
In France

JDK 8: lambdas in Action [FR]
http://www.devoxx.                                     O. Croisier
com/display/FR12/JDK+8+demo++lambdas+in
+Action
                                           G. Tardif

Java 8 et les Lambda [FR]
http://thecodersbreakfast.net/index.php?
post/2012/05/30/Java-8-et-les-Lambda

Curious about Project Lambda ;)
http://blog.xebia.fr/ [FR]
http://kerflyn.wordpress.com/                          Guess
                                                       Who?
Project Lambda
and the Community
● Transparency
  ○ Presentations / Publications
  ○ Source code available


● Early testing by community
  ○ Pre-version available
  ○ AdoptOpenJDK (http://java.
     net/projects/adoptopenjdk/pages/AdoptOpenJDK)


● Quick feedback
  ○ ML, Hackdays
Question
● Oneliner, Readability, and Debugability

● Java vs. Competitors

● What to do for Java 8 to be adopted in
  projects?

● Is there a future for Java?
Ad

More Related Content

What's hot (20)

Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
Eric Berry
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I
Atif AbbAsi
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
Alex Payne
 
Applicative style programming
Applicative style programmingApplicative style programming
Applicative style programming
José Luis García Hernández
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
Derek Chen-Becker
 
JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)
Scott Leberknight
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scala
Stratio
 
FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Dierk König
 
Scala: functional programming for the imperative mind
Scala: functional programming for the imperative mindScala: functional programming for the imperative mind
Scala: functional programming for the imperative mind
Sander Mak (@Sander_Mak)
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Mohammad Hossein Rimaz
 
Scala Jump Start
Scala Jump StartScala Jump Start
Scala Jump Start
Haim Michael
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
datamantra
 
Scala
ScalaScala
Scala
guest8996422d
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
Meir Maor
 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: Kotlin
Evolve
 
Exploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App developmentExploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App development
Jayaprakash R
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
LivePerson
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
Brian Hsu
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
Eric Berry
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I
Atif AbbAsi
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
Alex Payne
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
Derek Chen-Becker
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scala
Stratio
 
FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Dierk König
 
Scala: functional programming for the imperative mind
Scala: functional programming for the imperative mindScala: functional programming for the imperative mind
Scala: functional programming for the imperative mind
Sander Mak (@Sander_Mak)
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
datamantra
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
Meir Maor
 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: Kotlin
Evolve
 
Exploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App developmentExploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App development
Jayaprakash R
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
LivePerson
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
Brian Hsu
 

Similar to Java 8 Lambda (20)

Developing android apps with java 8
Developing android apps with java 8Developing android apps with java 8
Developing android apps with java 8
Jorge Castillo Pérez
 
What`s New in Java 8
What`s New in Java 8What`s New in Java 8
What`s New in Java 8
Mohsen Zainalpour
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
Nicola Pedot
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
Ahmed mar3y
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
Functional java 8
Functional java 8Functional java 8
Functional java 8
nick_maiorano
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
François Sarradin
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
Eugene Lazutkin
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
Marcos Almeida
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Svetlin Nakov
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
Jet presentation
Jet presentationJet presentation
Jet presentation
Peter Sellars
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
Martin Odersky
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
jbandi
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
Scala Italy
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
Alberto Paro
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
Ahmed mar3y
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
Eugene Lazutkin
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
EU projects MODAClouds and JUNIPER – Writing and testing transformations from...
Marcos Almeida
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Svetlin Nakov
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
jbandi
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
Scala Italy
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
Alberto Paro
 
Ad

Recently uploaded (20)

Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Ad

Java 8 Lambda

  • 1. JSR 335: λ Project Lambda François Sarradin -- Xebia
  • 2. Java Roadmap 337 Java 7 JSR Java 8 jul. 2011 aug. 2013 Java 9 ? Modularity Performance ● FP / Parallel comp. Productivity ● Date API improv. ● Type annotation ● Compact profiles ● Nashorn
  • 3. Project Lambda What's in it? Project Lambda JSR335 Virtual Extension Lambda Expression Method Collection API Collection API Functional API Parallel Collections Bulk Operations
  • 4. Question What will be the impact of Project Lambda on the Java world?
  • 6. Planning... Presentation + live coding (free to interrupt) ● Genesis ● Lambda of Java ● Project Lambda
  • 7. ...And Then ● Debate ● Retrospective (agile style!) ● Report ○ Xebia blog ○ Project Lambda ML
  • 10. More Expressiveness More Readability 结果 汉字 = new 物().処理(); vs. fact n = product [1..n] Is it all Chinese to you?
  • 11. FP & Competition Clojure C++ C# / F# Guava
  • 12. (Anonymous) Inner Class A λ Solution Iterables.filter(persons, new Predicate<Person>() { @Override public boolean apply(Person person) { return person.getAge() >= 18; } }); // Java + Guava
  • 13. (Anonymous) Inner Class A (better?) λ Solution Iterables.filter(persons, IS_ADULT); Predicate<Person> IS_ADULT = new Predicate<Person>() { @Override public boolean apply(Person person) { return person.getAge() >= 18; } }); This is what you really need!
  • 14. (Anonymous) Inner Class (Not Really) A λ Solution ● "The pain of anonymous inner classes makes us roll our eyes in the back of our heads every day." (a wise Oracle's client, 01/2011) Average length of Java one-liner is 21 line! @DEVOPS_BORAT - 12/09/2011
  • 15. What about Oracle? ● "It’s time to add closures to Java" (Mark Reinhold, 12/2009) ● "Oracle's position is that Java must evolve -- carefully, of course -- in order to remain competitive." (Brian Goetz - 08/2011)
  • 17. Here is the λ! (int x, int y) -> { return x + y; } (x, y) -> { return x + y; } (int x, int y) -> x + y (x, y) -> x + y
  • 18. Other λ forms x -> 2 * x () -> 42 m -> { m.put("France", "Paris"); m.put("UK", "London"); m.put("USA", "Washington"); }
  • 19. Inner Class vs. λ Solution Iterables.filter(persons, new Predicate<Person>() { @Override public boolean apply(Person p) { return p.getAge() >= 18; } }); // Java 5-7 + Guava Iterables.filter(persons, // Java 8 + Guava p -> p.getAge() >= 18);
  • 20. Method Reference String::valueOf // like: v -> String.valueOf(v) Integer::compare // like: (i1, i2) -> Integer.compare(i1, i2) Arrays.sort(myInts, Integer::compare)
  • 21. Virtual Extension Method (VEM) interface Message { String getMessage() default { return "Look Ma'! Interface with code!"; } }
  • 22. VEM Motivation VEM eg. Collection API Help to extend existing APIs Minimize rewrite of existing API implementation eg. Hibernate Collection Implementation
  • 23. Collection API Extended java.util.functions.* java.util.streams.* Extension of Iterable, Iterator, Collection, Map, ... java.util.Optional
  • 24. Parallel Computing As Easy as 1-2-3? myCollection.stream() .filter(x -> ...) .map(x -> ...) .reduce((x, y) -> ...) // sequential myCollection.parallel() .filter(x -> ...) .map(x -> ...) .reduce((x, y) -> ...) // parallel
  • 25. Some kata and demos...
  • 27. The Dream Team ;) photo: @crazybob
  • 28. Web Sites JSR335 http://jcp.org/en/jsr/detail?id=335 OpenJDK 8 Web site http://openjdk.java.net/projects/lambda/
  • 29. Where to Get Java 8 Java SE 8 Early Access (with lambda) http://jdk8.java.net/lambda/ Mercurial repo http://hg.openjdk.java.net/lambda/lambda
  • 30. Mailing Lists Technical Discussion mailto:[email protected] http://mail.openjdk.java.net/pipermail/lambda-dev/ Libs Spec Discussion http://mail.openjdk.java.net/pipermail/lambda-libs-spec-<*>/ Spec Discussion http://mail.openjdk.java.net/pipermail/lambda-spec-<*>/
  • 31. Around Project Lambda OpenJDK OSX Build (7 & 8) http://code.google.com/p/openjdk-osx-build/ H. Gomez Java 8 vs Scala: a Feature Comparison http://www.infoq.com/articles/java-8-vs-scala S. van den Berg U. Peter
  • 32. Around Project Lambda In France JDK 8: lambdas in Action [FR] http://www.devoxx. O. Croisier com/display/FR12/JDK+8+demo++lambdas+in +Action G. Tardif Java 8 et les Lambda [FR] http://thecodersbreakfast.net/index.php? post/2012/05/30/Java-8-et-les-Lambda Curious about Project Lambda ;) http://blog.xebia.fr/ [FR] http://kerflyn.wordpress.com/ Guess Who?
  • 33. Project Lambda and the Community ● Transparency ○ Presentations / Publications ○ Source code available ● Early testing by community ○ Pre-version available ○ AdoptOpenJDK (http://java. net/projects/adoptopenjdk/pages/AdoptOpenJDK) ● Quick feedback ○ ML, Hackdays
  • 34. Question ● Oneliner, Readability, and Debugability ● Java vs. Competitors ● What to do for Java 8 to be adopted in projects? ● Is there a future for Java?