Clean Lambdas: Enterprise Java Training
Clean Lambdas: Enterprise Java Training
Clean Lambdas
Victor Rentea
19 june 2017, Barcelona © Copyright Victor Rentea 2017
VictorRentea.ro
[email protected]
@victorrentea
VictorRentea.ro
Victor Rentea
Consultant, Technical Lead
Lead Architect for major IBM client Independent Trainer
1000+ devs. 1500+ hrs. 5 yrs.
Clean Code Evangelist
Spring, JavaEE, JPA/Hibernate
Speaker Clean Code, Architectures
Design Patterns
TDD, Coach, Coding Dojos
Java Performance, more...
[email protected] @victorrentea VictorRentea.ro
2 VictorRentea.ro
Clean Lambdas
Why Lambdas ?
They are cool
3 VictorRentea.ro
But is the Code still Clean ?
4 VictorRentea.ro
Clean Lambdas
Expressive ?
.filter(MyObj::isActive)
or My own little
Clean Lambdas study
Cryptic ?
.filter(order -> order.getOrderLines().stream()
.filter(line->line.isActive()).findFirst().isPresent())
.map(Order::getOrderLines)
.flatMap(List::stream)
.filter(orderLine -> orderLine.getCount().compareTo(new BigDecimal(“2”))
.collect(groupingBy(OrderLine::getProduct,
groupingBy(line->line.getOrder().getPaymentMethod(),
summingInt(OrderLine::getCount);
5 VictorRentea.ro
public static Predicate<Order> deliveryDueBefore(Date date) {
Local Variables Encapsulate Predicates
}
return order -> order.getDeliveryDueDate().before(date);
8 VictorRentea.ro
Peer Review!
Pair Programming
9 VictorRentea.ro
Where
can I read
LET’S
more ?
How to PRACTICE
apply all !!!
this in my
legacy
code
??
12 ©
Screen cast of my “Clean
Lambdas Workshop” at
VoxxedDays Bucharest
13
Check out my tweets for more
VictorRentea.ro
https://github.com/victorrentea/clean-lambdas-jbcnconf.git
Clean Lambdas
Victor Rentea
19 june 2017, Barcelona © Copyright Victor Rentea 2017
VictorRentea.ro
[email protected]
@victorrentea
VictorRentea.ro