Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
#DevoxxUK @victorrentea
Functional Programming
Patterns with Java 8
- live coding marathon -
Victor Rentea
IBM Lead Archit...
Victor Rentea
13 years of Java
Lead Architect at IBM
Tech Team Lead and Consultant
Clean Code Evangelist
victor.rentea@gma...
victorrentea.ro @victorrentea
 Spring
 Hibernate
 Clean Code, Architectures
 Java 8, Design Patterns
 Unit Testing
 ...
victorrentea.ro @victorrentea
Not Convinced?
5
Not Convinced?
They were!
victorrentea.ro @victorrentea
Hard-Core Switch
victorrentea.ro @victorrentea
Hard-Core Switch
victorrentea.ro @victorrentea
Let's CODE !!
9
I'll push everything here:
https://github.com/victorrentea/functional-patter...
victorrentea.ro @victorrentea
victorrentea.ro @victorrentea
The Clean Code Rules
Applied to Java 8
11
victorrentea.ro @victorrentea
Descriptive Names
Best Lambdas are fit, thin one-liners
Extract heavy lambdas into named ::m...
victorrentea.ro @victorrentea
Stream Wrecks
1 usecase = 1 single chain of 30 function calls.
Don't do that !
We beg you !
...
victorrentea.ro @victorrentea
Optional
Instead: thatOpt.map(myFunction)
No NullableParameters
Avoid Returning Null,Throw E...
victorrentea.ro @victorrentea
Passing-a-Block
Pass logic to your function
The Funeral of Template Method™
15
victorrentea.ro @victorrentea
Loan Pattern
You work with a resource
that is managed for you
Decouples real logic from infr...
victorrentea.ro @victorrentea
Execute Around Pattern
Explicit AOP
~ Proxy™ or Decorator™
17
victorrentea.ro @victorrentea
Avoid Checked Exceptions
java.util.function interfaces don't declare any throws
Which is goo...
victorrentea.ro @victorrentea
Type-specific Logic
switch
Switch Hunt Day®
Hope to find them all: JDD
Simplest to Read
1 sw...
victorrentea.ro @victorrentea
Thank You!
20
Disclaimer: The use of ® or
™ is the slides is only
anecdotic.
So good
we can ...
victorrentea.ro @victorrentea
Thank You!
21
Disclaimer: The use of ® or
™ is the slides is only
anecdotic.
victor.rentea@g...
victorrentea.ro @victorrentea
Thank You!
I'm available
a statement of seniority
I use both
hemispheres
Tough meetings?
Abu...
Functional Patterns with Java8 @Bucharest Java User Group
Upcoming SlideShare
Loading in …5
×

of

Functional Patterns with Java8 @Bucharest Java User Group Slide 1 Functional Patterns with Java8 @Bucharest Java User Group Slide 2 Functional Patterns with Java8 @Bucharest Java User Group Slide 3 Functional Patterns with Java8 @Bucharest Java User Group Slide 4 Functional Patterns with Java8 @Bucharest Java User Group Slide 5 Functional Patterns with Java8 @Bucharest Java User Group Slide 6 Functional Patterns with Java8 @Bucharest Java User Group Slide 7 Functional Patterns with Java8 @Bucharest Java User Group Slide 8 Functional Patterns with Java8 @Bucharest Java User Group Slide 9 Functional Patterns with Java8 @Bucharest Java User Group Slide 10 Functional Patterns with Java8 @Bucharest Java User Group Slide 11 Functional Patterns with Java8 @Bucharest Java User Group Slide 12 Functional Patterns with Java8 @Bucharest Java User Group Slide 13 Functional Patterns with Java8 @Bucharest Java User Group Slide 14 Functional Patterns with Java8 @Bucharest Java User Group Slide 15 Functional Patterns with Java8 @Bucharest Java User Group Slide 16 Functional Patterns with Java8 @Bucharest Java User Group Slide 17 Functional Patterns with Java8 @Bucharest Java User Group Slide 18 Functional Patterns with Java8 @Bucharest Java User Group Slide 19 Functional Patterns with Java8 @Bucharest Java User Group Slide 20 Functional Patterns with Java8 @Bucharest Java User Group Slide 21 Functional Patterns with Java8 @Bucharest Java User Group Slide 22
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Functional Patterns with Java8 @Bucharest Java User Group

Download to read offline

The slides for the presentation I gave at Bucharest Java User Group. This session was the largest Romanian Java community meetup ever organized until now.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Functional Patterns with Java8 @Bucharest Java User Group

  1. 1. #DevoxxUK @victorrentea Functional Programming Patterns with Java 8 - live coding marathon - Victor Rentea IBM Lead Architect & Independent Trainer victor.rentea@gmail.com www.VictorRentea.ro All the commits will be pushed to https://github.com/victorrentea/functional-patterns-bjug-2018.git
  2. 2. Victor Rentea 13 years of Java Lead Architect at IBM Tech Team Lead and Consultant Clean Code Evangelist victor.rentea@gmail.com www.VictorRentea.ro Moscow Paris London Krakow Vienna Sofia Casablanca Bucharest Belgrade Kiew Barcelona
  3. 3. victorrentea.ro @victorrentea  Spring  Hibernate  Clean Code, Architectures  Java 8, Design Patterns  Unit Testing  Java Performance  Scala & more... Independent Technical Trainer & Coach Victor.rentea@gmail.com VictorRentea.ro 1000+ devs 5 years tough clients:
  4. 4. victorrentea.ro @victorrentea Not Convinced? 5
  5. 5. Not Convinced? They were!
  6. 6. victorrentea.ro @victorrentea Hard-Core Switch
  7. 7. victorrentea.ro @victorrentea Hard-Core Switch
  8. 8. victorrentea.ro @victorrentea Let's CODE !! 9 I'll push everything here: https://github.com/victorrentea/functional-patterns-devoxx-uk
  9. 9. victorrentea.ro @victorrentea
  10. 10. victorrentea.ro @victorrentea The Clean Code Rules Applied to Java 8 11
  11. 11. victorrentea.ro @victorrentea Descriptive Names Best Lambdas are fit, thin one-liners Extract heavy lambdas into named ::methods  in the same class  in the item class  as static methods -> {a-nonymous functions 12 Lambdas
  12. 12. victorrentea.ro @victorrentea Stream Wrecks 1 usecase = 1 single chain of 30 function calls. Don't do that ! We beg you ! We have children, families,… Break them using explanatory variables Small Methods Five Lines 13
  13. 13. victorrentea.ro @victorrentea Optional Instead: thatOpt.map(myFunction) No NullableParameters Avoid Returning Null,Throw Ex … or return an Optional PS: don't be afraid of Orcs, Monads, or .flatMap 14
  14. 14. victorrentea.ro @victorrentea Passing-a-Block Pass logic to your function The Funeral of Template Method™ 15
  15. 15. victorrentea.ro @victorrentea Loan Pattern You work with a resource that is managed for you Decouples real logic from infra code 16
  16. 16. victorrentea.ro @victorrentea Execute Around Pattern Explicit AOP ~ Proxy™ or Decorator™ 17
  17. 17. victorrentea.ro @victorrentea Avoid Checked Exceptions java.util.function interfaces don't declare any throws Which is good ! You must suffer if you work with non-Runtime Exceptions! But if you insist: - Define throwing functional interfaces - Use libraries: jool, vavr... 18
  18. 18. victorrentea.ro @victorrentea Type-specific Logic switch Switch Hunt Day® Hope to find them all: JDD Simplest to Read 1 switch = 1 method case XX: return … OOP Extends is BAD ONE Shot Children90Movie enum Isolated Logic In enum methods Logic with Dependencies Function references on enums (bean passed as param) 19
  19. 19. victorrentea.ro @victorrentea Thank You! 20 Disclaimer: The use of ® or ™ is the slides is only anecdotic. So good we can ask more explanations after the Pizza What was that??
  20. 20. victorrentea.ro @victorrentea Thank You! 21 Disclaimer: The use of ® or ™ is the slides is only anecdotic. victor.rentea@gmail.com www.VictorRentea.ro Let's Chat:
  21. 21. victorrentea.ro @victorrentea Thank You! I'm available a statement of seniority I use both hemispheres Tough meetings? Abused estimates? Purpose of code: 1. Maintainable -- Uncle Bob Functional Party Activist Stay into The Light I brought you some Motivational Stickers In-house/remote training or coaching? What do You want us to do the second hour? (after the Pizza) victorrentea.ro/vote.html Dissect some examples Basic Java8 Tutorial (Slow-motion) Mocking Kata TDD Kata Spring @Transactional victor.rentea@gmail.com www.VictorRentea.ro

The slides for the presentation I gave at Bucharest Java User Group. This session was the largest Romanian Java community meetup ever organized until now.

Views

Total views

42,787

On Slideshare

0

From embeds

0

Number of embeds

41,654

Actions

Downloads

21

Shares

0

Comments

0

Likes

0

×