SlideShare a Scribd company logo
1 of 29
Download to read offline
Revolution of Java
Java 8 – Project Lambda
About Me
• Java Developer
• Technical Teacher
• Blogger @kodcu.com
Java 8 Innovations

• Lambda Expressions

• Type Inference

• Metod References

• Collection II

• Defender Methods
Functional Interface ?
• An Interface includes only one abstract
  method called as FunctionalInterface


• Lambda expressions are converted to a FI’s
  implementation in Background
Functional Interface Examps.
• java.lang.Runnable
• java.util.concurrent.Callable
• java.nio.file.PathMatcher
• java.lang.reflect.InvocationHandler
• java.beans.PropertyChangeListener
• java.awt.event.ActionListener
Lambda Expressions
• Lambda -> (also called Closures), is an expression
  that reduces vertical boilerplate code.

• Concise and Clear code development practice

• Interfaces that consist of one more than abstract
  method, cannot be counterpart of any Lambda
  expressions.

   Tip: Exceptions (Defender methods & Object class’ methods)
Focus to Input & Output
Runnable r1=new Runnable() {

        @Override             Input

        public void run() {

             Output

            System.out.println(“Hello Uranus.");

        }
   };
Example
Lambda Types

• 2 type
  – Single expression // no need “return”
     • (Integer s) -> ( s*2 );
     • |or| (Integer s) -> s*2 ;



  – Statement Block
     • (Integer s) -> { return s*2; };
Type Inference

(String s) -> { System.out.println(s); };
// equals

(s) -> { System.out.println(s); };
// equals

s   -> { System.out.println(s); };
Type Inference

(Integer   a, Integer b)    -> a + b;
// equals

(a,b) -> (a+b);
Metod References
Runnable r1=new Runnable() {

        @Override             Input

        public void run() {

             Output

            System.out.println(“Hello Uranus.");

        }
   };
Metod References
Collection II
• Collection II is an attachment to existing
  Collection Framework.

• Supports Jquery like chained methods and
  Underscore.js like Functional Programming
  Experience.
Collection II
• Existing Collection Framework does not
  support Concurrent operations in
  chunked datas.

• Cause, existing one applies External
  Iteration.
Stream <T> Interface
• Sequential and Consumable data structure.

• The data cannot be fetch again after consumed.

• A Stream object can be obtained any data
  structure in Collection Framework.

• Fo.Exm: LinkedList, ArrayList, HashSet.
java.util.function
         Functional Interfaces

• Those special Interfaces
  support general data
  operations.
Consumer<T> -> Applying
• Consumer gets an input and runs an action.

• Does not return any result, only do an action.



  public void accept(T t);
Predicate<T> -> Filtering
• Predicate gets a conditional code and
  produce -> true || false

• In concise, makes filtering.


  public boolean test(T t);
Function<T, R> -> (Consume & Produce);
• Gets any type of input object and Produce an
  output object.



     public R apply(T t);
Supplier<T>
• Do not get any argument object, only returns
  instantiation of any object type.



    public T get();
Bi?
BiPredicate<L, R>    Compares two inputted object.

BiConsumer<T, U>     Consumes two type of objects, and produce no result

BiFunction<T, U, R> Gets two input object (T , U) and produce a result (R)


                                   .
                                   .
                                   .
Parallel Stream
• Any parallelizable operations can run
  concurrently with Parallel stream object.

• Parallel Stream object can be obtain with
  parallelStream() method from any Streamable
  data structure.
Lazily & Eagerly Ops.
• Some Stream operations can be run Lazly as
  some Eagerly.
         Lazy          Eager

• .filter().map().allMatch();
                Lazy            Eager

• .filter().filter().sorted().forEach();
Lazily & Eagerly
• Lazy operations are evaluated together with
  first encountered Eager operation.

• The goal is evaluate chanied operations in
  one step.
Defender Methods
• Before Java 8, Interfaces can contain only
  abstract methods.

• With Java 8, any Interface can contain one or
  more concrete methods that named
  default/defender method.

• Tip: Default methods do not break nature of F           I
                                                  onctional nterfaces
Defender Methods

• Defender Methods, Default Methods, Virtual extension methods

• Makes possible usage of concrete methods.

• Makes more elastic of Java Inheritance model.
Defender Methods
• Defender methods can be re-implemented or
  inherited by other Interfaces.
?
??
???
????
?????   Q/A
????
???
??
?

More Related Content

What's hot

What's hot (20)

Java8 features
Java8 featuresJava8 features
Java8 features
 
Major Java 8 features
Major Java 8 featuresMajor Java 8 features
Major Java 8 features
 
java 8 new features
java 8 new features java 8 new features
java 8 new features
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
 
Java 8 Features
Java 8 FeaturesJava 8 Features
Java 8 Features
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Java8
Java8Java8
Java8
 
Eclipse Day India 2015 - Java 8 Overview
Eclipse Day India 2015 - Java 8 OverviewEclipse Day India 2015 - Java 8 Overview
Eclipse Day India 2015 - Java 8 Overview
 
Java SE 8 - New Features
Java SE 8 - New FeaturesJava SE 8 - New Features
Java SE 8 - New Features
 
Functional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singhFunctional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singh
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
 
Java 8 Streams And Common Operations By Harmeet Singh(Taara)
Java 8 Streams And Common Operations By Harmeet Singh(Taara)Java 8 Streams And Common Operations By Harmeet Singh(Taara)
Java 8 Streams And Common Operations By Harmeet Singh(Taara)
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
Java 8 new features
Java 8 new featuresJava 8 new features
Java 8 new features
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In Practice
 

Viewers also liked

Slideshare Power Point Sunumu
Slideshare Power Point SunumuSlideshare Power Point Sunumu
Slideshare Power Point Sunumuguest5b8685
 
SLİDESHARE NASIL KULLANILIR?
SLİDESHARE NASIL KULLANILIR?SLİDESHARE NASIL KULLANILIR?
SLİDESHARE NASIL KULLANILIR?Orkun Güren
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilLemi Orhan Ergin
 
Java Exception Handling Best Practices - Improved Second Version
Java Exception Handling Best Practices - Improved Second VersionJava Exception Handling Best Practices - Improved Second Version
Java Exception Handling Best Practices - Improved Second VersionLemi Orhan Ergin
 
Digital Sketchnotes 101
Digital Sketchnotes 101Digital Sketchnotes 101
Digital Sketchnotes 101Karen Bosch
 
Snapchat Visual Marketing Strategy
Snapchat Visual Marketing StrategySnapchat Visual Marketing Strategy
Snapchat Visual Marketing StrategyKatai Robert
 
The Sketchnote Mini-Workshop
The Sketchnote Mini-WorkshopThe Sketchnote Mini-Workshop
The Sketchnote Mini-WorkshopMike Rohde
 
Clean and green hydrocarbons ignite publish
Clean and green hydrocarbons ignite publishClean and green hydrocarbons ignite publish
Clean and green hydrocarbons ignite publishKrzysztof (Kris) Palka
 
17 Ways to Design a Presentation People Want to View
17 Ways to Design a Presentation People Want to View17 Ways to Design a Presentation People Want to View
17 Ways to Design a Presentation People Want to ViewJim MacLeod
 

Viewers also liked (11)

Slideshare Power Point Sunumu
Slideshare Power Point SunumuSlideshare Power Point Sunumu
Slideshare Power Point Sunumu
 
Slideshare nedir
Slideshare nedirSlideshare nedir
Slideshare nedir
 
SLİDESHARE NASIL KULLANILIR?
SLİDESHARE NASIL KULLANILIR?SLİDESHARE NASIL KULLANILIR?
SLİDESHARE NASIL KULLANILIR?
 
Slideshare net
Slideshare netSlideshare net
Slideshare net
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi Değil
 
Java Exception Handling Best Practices - Improved Second Version
Java Exception Handling Best Practices - Improved Second VersionJava Exception Handling Best Practices - Improved Second Version
Java Exception Handling Best Practices - Improved Second Version
 
Digital Sketchnotes 101
Digital Sketchnotes 101Digital Sketchnotes 101
Digital Sketchnotes 101
 
Snapchat Visual Marketing Strategy
Snapchat Visual Marketing StrategySnapchat Visual Marketing Strategy
Snapchat Visual Marketing Strategy
 
The Sketchnote Mini-Workshop
The Sketchnote Mini-WorkshopThe Sketchnote Mini-Workshop
The Sketchnote Mini-Workshop
 
Clean and green hydrocarbons ignite publish
Clean and green hydrocarbons ignite publishClean and green hydrocarbons ignite publish
Clean and green hydrocarbons ignite publish
 
17 Ways to Design a Presentation People Want to View
17 Ways to Design a Presentation People Want to View17 Ways to Design a Presentation People Want to View
17 Ways to Design a Presentation People Want to View
 

Similar to Java 8 - Project Lambda

Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The BasicsSimon Ritter
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesRaffi Khatchadourian
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigoujaxconf
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streamsjessitron
 
Java tutorials
Java tutorialsJava tutorials
Java tutorialssaryu2011
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaSimon Ritter
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.Tarunsingh198
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryPray Desai
 
Stream Api.pdf
Stream Api.pdfStream Api.pdf
Stream Api.pdfAkaks
 
JavaTutorials.ppt
JavaTutorials.pptJavaTutorials.ppt
JavaTutorials.pptKhizar40
 
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterJAXLondon2014
 
Lambdas And Streams in JDK8
Lambdas And Streams in JDK8Lambdas And Streams in JDK8
Lambdas And Streams in JDK8Simon Ritter
 
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Raffi Khatchadourian
 

Similar to Java 8 - Project Lambda (20)

Lambdas in Java 8
Lambdas in Java 8Lambdas in Java 8
Lambdas in Java 8
 
Collections
CollectionsCollections
Collections
 
Lambdas and Laughs
Lambdas and LaughsLambdas and Laughs
Lambdas and Laughs
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The Basics
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigou
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
08 subprograms
08 subprograms08 subprograms
08 subprograms
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Java 8
Java 8Java 8
Java 8
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Stream Api.pdf
Stream Api.pdfStream Api.pdf
Stream Api.pdf
 
JavaTutorials.ppt
JavaTutorials.pptJavaTutorials.ppt
JavaTutorials.ppt
 
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
 
Lambdas And Streams in JDK8
Lambdas And Streams in JDK8Lambdas And Streams in JDK8
Lambdas And Streams in JDK8
 
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
 

More from Rahman USTA

JShell: The Ultimate Missing Tool
JShell: The Ultimate Missing ToolJShell: The Ultimate Missing Tool
JShell: The Ultimate Missing ToolRahman USTA
 
Digital Authoring with Asciidoc(tor) and AsciidocFX
Digital Authoring with Asciidoc(tor) and AsciidocFXDigital Authoring with Asciidoc(tor) and AsciidocFX
Digital Authoring with Asciidoc(tor) and AsciidocFXRahman USTA
 
JavaOne 2016 - The JCP (Java Community Process)
JavaOne 2016 - The JCP (Java Community Process)JavaOne 2016 - The JCP (Java Community Process)
JavaOne 2016 - The JCP (Java Community Process)Rahman USTA
 
Java 9 Project Jigsaw
Java 9 Project JigsawJava 9 Project Jigsaw
Java 9 Project JigsawRahman USTA
 
Java EE Nedir? (Baku JUG)
Java EE Nedir? (Baku JUG)Java EE Nedir? (Baku JUG)
Java EE Nedir? (Baku JUG)Rahman USTA
 
Java 8 Nashorn ve Avatar.js
Java 8 Nashorn ve Avatar.jsJava 8 Nashorn ve Avatar.js
Java 8 Nashorn ve Avatar.jsRahman USTA
 

More from Rahman USTA (6)

JShell: The Ultimate Missing Tool
JShell: The Ultimate Missing ToolJShell: The Ultimate Missing Tool
JShell: The Ultimate Missing Tool
 
Digital Authoring with Asciidoc(tor) and AsciidocFX
Digital Authoring with Asciidoc(tor) and AsciidocFXDigital Authoring with Asciidoc(tor) and AsciidocFX
Digital Authoring with Asciidoc(tor) and AsciidocFX
 
JavaOne 2016 - The JCP (Java Community Process)
JavaOne 2016 - The JCP (Java Community Process)JavaOne 2016 - The JCP (Java Community Process)
JavaOne 2016 - The JCP (Java Community Process)
 
Java 9 Project Jigsaw
Java 9 Project JigsawJava 9 Project Jigsaw
Java 9 Project Jigsaw
 
Java EE Nedir? (Baku JUG)
Java EE Nedir? (Baku JUG)Java EE Nedir? (Baku JUG)
Java EE Nedir? (Baku JUG)
 
Java 8 Nashorn ve Avatar.js
Java 8 Nashorn ve Avatar.jsJava 8 Nashorn ve Avatar.js
Java 8 Nashorn ve Avatar.js
 

Recently uploaded

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 

Recently uploaded (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 

Java 8 - Project Lambda

  • 1. Revolution of Java Java 8 – Project Lambda
  • 2. About Me • Java Developer • Technical Teacher • Blogger @kodcu.com
  • 3. Java 8 Innovations • Lambda Expressions • Type Inference • Metod References • Collection II • Defender Methods
  • 4. Functional Interface ? • An Interface includes only one abstract method called as FunctionalInterface • Lambda expressions are converted to a FI’s implementation in Background
  • 5. Functional Interface Examps. • java.lang.Runnable • java.util.concurrent.Callable • java.nio.file.PathMatcher • java.lang.reflect.InvocationHandler • java.beans.PropertyChangeListener • java.awt.event.ActionListener
  • 6. Lambda Expressions • Lambda -> (also called Closures), is an expression that reduces vertical boilerplate code. • Concise and Clear code development practice • Interfaces that consist of one more than abstract method, cannot be counterpart of any Lambda expressions. Tip: Exceptions (Defender methods & Object class’ methods)
  • 7. Focus to Input & Output Runnable r1=new Runnable() { @Override Input public void run() { Output System.out.println(“Hello Uranus."); } };
  • 9. Lambda Types • 2 type – Single expression // no need “return” • (Integer s) -> ( s*2 ); • |or| (Integer s) -> s*2 ; – Statement Block • (Integer s) -> { return s*2; };
  • 10. Type Inference (String s) -> { System.out.println(s); }; // equals (s) -> { System.out.println(s); }; // equals s -> { System.out.println(s); };
  • 11. Type Inference (Integer a, Integer b) -> a + b; // equals (a,b) -> (a+b);
  • 12. Metod References Runnable r1=new Runnable() { @Override Input public void run() { Output System.out.println(“Hello Uranus."); } };
  • 14. Collection II • Collection II is an attachment to existing Collection Framework. • Supports Jquery like chained methods and Underscore.js like Functional Programming Experience.
  • 15. Collection II • Existing Collection Framework does not support Concurrent operations in chunked datas. • Cause, existing one applies External Iteration.
  • 16. Stream <T> Interface • Sequential and Consumable data structure. • The data cannot be fetch again after consumed. • A Stream object can be obtained any data structure in Collection Framework. • Fo.Exm: LinkedList, ArrayList, HashSet.
  • 17. java.util.function Functional Interfaces • Those special Interfaces support general data operations.
  • 18. Consumer<T> -> Applying • Consumer gets an input and runs an action. • Does not return any result, only do an action. public void accept(T t);
  • 19. Predicate<T> -> Filtering • Predicate gets a conditional code and produce -> true || false • In concise, makes filtering. public boolean test(T t);
  • 20. Function<T, R> -> (Consume & Produce); • Gets any type of input object and Produce an output object. public R apply(T t);
  • 21. Supplier<T> • Do not get any argument object, only returns instantiation of any object type. public T get();
  • 22. Bi? BiPredicate<L, R> Compares two inputted object. BiConsumer<T, U> Consumes two type of objects, and produce no result BiFunction<T, U, R> Gets two input object (T , U) and produce a result (R) . . .
  • 23. Parallel Stream • Any parallelizable operations can run concurrently with Parallel stream object. • Parallel Stream object can be obtain with parallelStream() method from any Streamable data structure.
  • 24. Lazily & Eagerly Ops. • Some Stream operations can be run Lazly as some Eagerly. Lazy Eager • .filter().map().allMatch(); Lazy Eager • .filter().filter().sorted().forEach();
  • 25. Lazily & Eagerly • Lazy operations are evaluated together with first encountered Eager operation. • The goal is evaluate chanied operations in one step.
  • 26. Defender Methods • Before Java 8, Interfaces can contain only abstract methods. • With Java 8, any Interface can contain one or more concrete methods that named default/defender method. • Tip: Default methods do not break nature of F I onctional nterfaces
  • 27. Defender Methods • Defender Methods, Default Methods, Virtual extension methods • Makes possible usage of concrete methods. • Makes more elastic of Java Inheritance model.
  • 28. Defender Methods • Defender methods can be re-implemented or inherited by other Interfaces.
  • 29. ? ?? ??? ???? ????? Q/A ???? ??? ?? ?