Design Patterns Revisited in Modern Java
summary
Explains concrete rules and code examples: Optional prevents many NPEs when used as a return type but adds overhead and causes confusion as fields or parameters, so return Optional only for maybe-missing values and avoid Optional fields/params; strategy becomes simple lambdas (no extra classes); Supplier defers work to implement lazy evaluation and saves wasted slow computations so use Supplier to defer expensive work; compose Function filters as lightweight decorators; provide an execute‑around Consumer pattern to always close resources; sealed interfaces limit who can implement and pattern matching reduces visitor boilerplate.
AI-written summary · about
chapters (11)
- 0:00Introduction to workshop
- 1:03Design patterns overview
- 9:30Optional anti-patterns
- 30:50Java evolution and patterns
- 1:00:40Strategy pattern with lambdas
- 1:22:56Break
- 1:42:00Lazy evaluation with suppliers
- 2:06:50Decorator pattern with functions
- 2:22:56Fluent interfaces
- 2:33:24Execute around method pattern
- 2:40:16Sealed classes and data orientation
related talks
01h 03mJava Design Patterns 2022
44mDesign Patterns in the Light of Lambda Expressions
48mDo You Use the Optional Class as It Should Be
55mThe modern view on implementation of classic design patterns in Java
55mRevisiting Design Patterns After 20
57mDo You Use the Optional Class as it Should Be
50mDo you use the Optional class as it should be?
55mFunctional Programming Patterns with Java8
