SlideShare a Scribd company logo
F U N C T I O N A L - R E A C T I V E
@ S V E N R U P P E R T
5
S T O R Y A N D P H I L O S O P H Y
Software is eating the world and what most of us see of it is the user interface. The user
interface has become the key component of how the users experience the business
behind it. Competition is lost or won due to user experience. Simplicity is king and the
users get frustrated by anything ugly, slow or not working on the device they happen to
use at the time. We at Vaadin fight for simplicity and invite everyone to join this fight.
Together we want to build a user interface that puts a smile on the user’s face.
Vaadin is the technology that empowers developers to build the best web-apps for
business purposes. Our priority over everything else is developer productivity because
we believe that by simplifying the developer experience and saving the developer’s
time, they are best able to focus on building great user interfaces.
Our brand is what we want everyone to think about us. When everyone - both us and
the people around us - have a consistent understanding of what Vaadin is and what we
stand for, it enables that image to spread and amplify. This book defines what we want
that image to be. It defines what the Vaadin brand is.
I hope that You are as excited and proud of living and breathing the Vaadin brand as
I am. You are the one who is shaping what everyone thinks about Vaadin - using this
brand as a tool and a guideline every day.
Let’s fight for simplicity for both the users and the developers!
Joonas Lehtinen
Founder & CEO
Vaadin
I N T R O D U C T I O N
W I T H C O R E J AVA 8 - 11 A N D B E Y O N D
S V E N R U P P E R T 

Developer Advocate @ Vaadin
5
C O D I N G J AVA S I N C E 1 9 9 6
C O N S U LT I N G W O R L D W I D E
Public Sector: Military / Government
Private Sector: Automotive / Aerospace / SMB /
NonProfit / NonGov: World Bank / UN / YPARD / CGIAR
D I S T R I B U T E D S Y S T E M S S I N C E 2 0 0 2
J O I N E D VA A D I N 2 0 1 7
I N T R O
D I F F E R E N C E S B E T W E E N O O A N D F P I N J AVA
4
@SvenRuppertJava8 - Optional<T>
the border between OO and FP in Java is not 100% clear.
@SvenRuppert
S I N C E J AVA 8
Functional Interfaces - basics
6
@SvenRuppertJava8 - Functional Interfaces
7
@SvenRuppertJava8 - Functional Interfaces
8
@SvenRuppertJava8 - Functional Interfaces
9
@SvenRuppertJava8 - Functional Interfaces
10
@SvenRuppertJava9 - Functional Interfaces
Java9 - JEP213
@SvenRuppert
S I N C E J AVA 8
Optional<T>
Optional<T> @SvenRuppert
Optional<T> @SvenRuppert
Optional<T> @SvenRuppert
Optional<T> - since JDK10 @SvenRuppert
@SvenRuppert
S I N C E J AVA 8
Result<T>
Optional<T> @SvenRuppert
Not symmetric
Not async - blocking only
Not functional enough
Declared final - no inheritance Having ValueTypes in mind
We need something
Result<T> @SvenRuppert
Must be easy to transform Optional <-> Result
Should work as an Drop-In-Replacement
Should connect to the Reactive-World
Should be symmetric
Must fit functional style / oo style
Result<T> @SvenRuppert
Transform from and to an Optional
pos. and neg. available
@SvenRuppert
Symmetric
Handle both ways
Result<T>
@SvenRuppert
Handle both ways
Async if needed
Result<T>
@SvenRuppert
Combine with Value and Transformation
Async if needed
Result<T>
@SvenRuppert
Combine with Value / Function
Async if needed
Combine with a function
Result<T>
@SvenRuppert
S I N C E J AVA 8
Exceptions
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
JDK9
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
Exceptions @SvenRuppert
@SvenRuppert
H O W T O U S E F U N C T I O N S …
Functions - Basics
Functions - Java8
36
@SvenRuppert
a function is a transformation
input -> output
(input - type, input value) (output - type, output value)
Functions - Java8
37
@SvenRuppert
38
@SvenRuppertFunctions - Java8
39
@SvenRuppertFunctions - Java8
40
@SvenRuppertFunctions - Java8
41
@SvenRuppert
Compose is not so nice.. but
Functions - Java8
42
@SvenRuppert
Attention : make a semantic equal function !!
Functions - Java8
43
@SvenRuppertFunctions - Java8
How to get an instance of a function?
44
@SvenRuppertFunctions - Java8
45
@SvenRuppertFunctions - Java8
46
@SvenRuppertFunctions - Java8
Functions - Java8 - extract the logic !
47
@SvenRuppert
48
@SvenRuppertFunctions - Java8
49
@SvenRuppertFunctions - Java8
@SvenRuppert
G E N E R I C B A C K A N D F O R WA R D
Currying
Currying @SvenRuppert
@SvenRuppertCurrying
@SvenRuppertCurrying
@SvenRuppertCurrying
@SvenRuppert
P U R E F U N C T I O N A L B E H AV I O R
Memoizing
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
Memoizing @SvenRuppert
@SvenRuppert
H O W T O D E C I D E ?
Case
Case @SvenRuppert
@SvenRuppertCase
@SvenRuppertCase
@SvenRuppertCase
@SvenRuppertCase
@SvenRuppert
H O W T O U S E , H O W T O B U I L D
Streams
Streams @SvenRuppert
A Stream is active after creation
want to define a Stream without starting it
maybe creating it interactively
we need a function !
Function<T, Stream<R>>
Function<Stream<T>, Stream<R>>
@SvenRuppert
H O W R E A C T I V E W I L L S TA R T
Observer
76
@SvenRuppertObserver
77
@SvenRuppertObserver
78
@SvenRuppertObserver
79
@SvenRuppertObserver
key not needed anymore
80
@SvenRuppertObserver
@SvenRuppert
H O W T O U S E F U N C T I O N S … A S Y N C …
CompletableFuture
82
@SvenRuppertJava8 - CompletableFuture
Process
Thread
Fiber
CompletionStage CompletionStage CompletionStage
83
@SvenRuppertJava8 - CompletableFuture
84
@SvenRuppertJava8 - CompletableFuture
85
@SvenRuppert
Operator 1
Value A
Operator 2a
Result
Value B Value C
Java8 - CompletableFuture
86
@SvenRuppertJava8 - CompletableFuture
87
@SvenRuppertJava8 - CompletableFuture
88
@SvenRuppertJava8 - CompletableFuture
89
@SvenRuppertJava8 - CompletableFuture
Operator 1
Value A
Operator 2a
Result
Value B Value C
@SvenRuppert
H O W T O C R E AT E A G R A P H E A S Y. .
CompletableFutureQueue
91
@SvenRuppertCompletableFutureQueue
CompletableFuture is active after creation
want to define a CompletableFuture without starting it
maybe creating it interactively
we need a function !
Function<T, CompletableFuture<R>>
Function<
CompletableFuture<T>,
CompletableFuture<R>>
92
@SvenRuppertCompletableFutureQueue
93
@SvenRuppertCompletableFutureQueue
Summary
94
@SvenRuppert
places to read more about it
https://github.com/functional-reactive
Summary
95
@SvenRuppert
please, follow me ;-)
@SvenRuppert
Thank You !!!

More Related Content

PDF
Vaadin Flow - How to start - a short intro for Java Devs
PDF
Vehicle Consumer Services Interface - In-Vehicle Middleware - Vladimir Rasin,...
TXT
Mods4cars Announces SmartTOP Convertible Top Controller for Jaguar F-Type Con...
PDF
Functional Reactive with Core Java - Workshop - Slides
PDF
Going web native - Feb 2018
PDF
Going web native
PDF
Vaadin 8 and 10
PPTX
Java 8 - An Overview
Vaadin Flow - How to start - a short intro for Java Devs
Vehicle Consumer Services Interface - In-Vehicle Middleware - Vladimir Rasin,...
Mods4cars Announces SmartTOP Convertible Top Controller for Jaguar F-Type Con...
Functional Reactive with Core Java - Workshop - Slides
Going web native - Feb 2018
Going web native
Vaadin 8 and 10
Java 8 - An Overview

Similar to Functional Reactive With Core Java - Voxxed Melbourne (20)

PDF
From desktop to the cloud, cutting costs with Virtual kubelet and ACI
PDF
Functional Programming In Java Harnessing The Power Of Java 8 Lambda Expressi...
PDF
Functional Programming In Java Harnessing The Power Of Java 8 Lambda Expressi...
PDF
IPT High Performance Reactive Java BGOUG 2016
PDF
2014 java functional
PDF
Fun with java 8
PDF
Java 8 Interview Questions and Answers PDF By ScholarHat.pdf
PDF
PDF
The Brainify App - JavaFx
PPTX
What's new for JavaFX in JDK8 - Weaver
PPTX
Software Uni Conf October 2014
PDF
Stream Processing with CompletableFuture and Flow in Java 9
PPTX
Insight into java 1.8, OOP VS FP
PDF
Vaadin DevDay 2017 - Web Components
PPTX
Intro to java 8
PPT
14274730 (1).ppt
PPTX
Functional programming with Java 8
PDF
Java 8-revealed
PDF
10 Big Ideas from Industry
PDF
Java 8 - functional features
From desktop to the cloud, cutting costs with Virtual kubelet and ACI
Functional Programming In Java Harnessing The Power Of Java 8 Lambda Expressi...
Functional Programming In Java Harnessing The Power Of Java 8 Lambda Expressi...
IPT High Performance Reactive Java BGOUG 2016
2014 java functional
Fun with java 8
Java 8 Interview Questions and Answers PDF By ScholarHat.pdf
The Brainify App - JavaFx
What's new for JavaFX in JDK8 - Weaver
Software Uni Conf October 2014
Stream Processing with CompletableFuture and Flow in Java 9
Insight into java 1.8, OOP VS FP
Vaadin DevDay 2017 - Web Components
Intro to java 8
14274730 (1).ppt
Functional programming with Java 8
Java 8-revealed
10 Big Ideas from Industry
Java 8 - functional features
Ad

More from Sven Ruppert (14)

PDF
JUnit5 Custom TestEngines intro - version 2020-06
PDF
Hidden pearls for High-Performance-Persistence
PDF
Functional reactive-talk 20170301-001
PDF
From Mess To Masterpiece - JFokus 2017
PDF
From Jurassic Park to Microservices
PDF
From jUnit to Mutationtesting
PDF
DI Frameworks - hidden pearls
PDF
Warum ich so auf das c von cdi stehe
PDF
Proxy deep-dive java-one_20151027_001
PDF
Java8 ready for the future
PDF
JavaFX8 TestFX - CDI
PDF
Java FX8 JumpStart - JUG ch - zürich
PDF
Proxy Deep Dive JUG Saxony Day 2015-10-02
PDF
Proxy Deep Dive Voxxed Belgrad 2015
JUnit5 Custom TestEngines intro - version 2020-06
Hidden pearls for High-Performance-Persistence
Functional reactive-talk 20170301-001
From Mess To Masterpiece - JFokus 2017
From Jurassic Park to Microservices
From jUnit to Mutationtesting
DI Frameworks - hidden pearls
Warum ich so auf das c von cdi stehe
Proxy deep-dive java-one_20151027_001
Java8 ready for the future
JavaFX8 TestFX - CDI
Java FX8 JumpStart - JUG ch - zürich
Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive Voxxed Belgrad 2015
Ad

Recently uploaded (20)

PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Digital Strategies for Manufacturing Companies
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administration Chapter 2
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Operating system designcfffgfgggggggvggggggggg
Digital Systems & Binary Numbers (comprehensive )
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Understanding Forklifts - TECH EHS Solution
Digital Strategies for Manufacturing Companies
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Reimagine Home Health with the Power of Agentic AI​
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms I-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administration Chapter 2
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Computer Software and OS of computer science of grade 11.pptx
How to Choose the Right IT Partner for Your Business in Malaysia

Functional Reactive With Core Java - Voxxed Melbourne