The slides for my talk at Devoxx BE 2018.
Contents: Optional, method references over heavy lambdas, Passing-a-Block, Loan Pattern, Execute Around, Hiding Checked Exceptions, Method References on Enums.
This talk was rated #1 talk of the whole conference.
2. Victor Rentea
14 years of Java
Clean Code Evangelist
VictorRentea.ro
Moscow Paris London Krakow Vienna Sofia Casablanca Belgrade Kiew Barcelona
.NET
+ more
Lead Architect
Tech Team Lead and Consultant
Software Craftsman
XP: Pair Programming, Refactoring, TDD
Bucharest
Software
Craftsmanship
Community
founder of
10. VictorRentea.ro10
Execute arbitrary logic within a function
CPP
+1 boolean param
Extract & @Override
Template Method®
Passing-a-Block
exporter.exportFile("orders.csv", orderWriter::writeContent);
11. VictorRentea.ro11
The Loan Pattern
Passing-a-Block
try (Writer writer = new FileWriter(file)) {
contentWriter.accept(writer);
return file;
} catch (...) {
...
}
exporter.exportFile("orders.csv", orderWriter::writeContent);
contentWriter is "loaned"
a Writer managed here
similarly:
Testable
Infrastructure decoupled from export format
test with a dummy format test with a StringWriter
14. VictorRentea.ro14
switch
Switch Hunt Day
Hope to find them all: JDD
Simplest
1 switch = 1 method
case XX: return …
OOP
Extends is BAD
Combinatorial
Children90Movie
enum
Logic Bits
In enum methods
Logic with Dependencies
Function references on enums
Type-specific Logic
17. 17
Too
Disclaimer: The use of ® or ™ is the slides is only anecdotic. VictorRentea.ro
Thank You!
Let's chat!
Read it all in my dzone article
dzone.com/articles/functional-programming-patterns-with-java-8
18. 18
Too
VictorRentea.ro
I'm available
a statement of seniority
I use both hemispheres
Tough meetings?
Abused estimates?
Purpose of code:--Uncle Bob
1. Maintainable
2. Does its job!
Functional Party
Activist
Stay into
The Light
Trainings, talks, goodies
@VictorRentea
Quality posts daily on
Clean Code
needs strength
and determination
Thank You!
come take 1 sticker
Let's chat!
or a poster
Read it all in my dzone article
dzone.com/articles/functional-programming-patterns-with-java-8
(for tech leads)
Notes de l'éditeur
Salut! Eu sunt Victor si am 14 ani… de lucru cu Java, desi in ultimii ani am fost impins sa invat si PHP, Scala si C#.
Lucrez la IBM ca Lead Archirect, in Bucuresti. Stiati voi ca aveti un IBM chiar aici in Cluj, intr-un sediu nou-nout. In….
De fapt, cu ajorul IBM sunt astazi aici cu voi.
Stiu deja ce ganditi… aa.. E architect. Sta undeva langa un ficus si deseneaza pe pereti diagrame UML..
-NU . Eu bag la cod. Lucrez pe cele mai dificile proiecte pe care le avem.
La sfarsh:Sala mare -