Design Patterns in the Light of Lambda Expressions
summary
Shows how common OO patterns shrink into a few lambdas: the Strategy becomes a simple method taking a Predicate (example totals 1–10 → 55 then filters evens/odds), the Decorator becomes function composition using Function.reduce and Function.identity, and resource management becomes a static resource.use(Consumer) that makes constructor and close private so cleanup always runs (a concrete execute-around or loan pattern). Uses Java features: Predicate, Function, Stream.reduce, Consumer, AutoCloseable/try-with-resources; examples compile conceptually and remove boilerplate.
AI-written summary · about
chapters (8)
- 0:00Introduction to design patterns
- 2:11Design patterns as communication tools
- 3:36Lambdas and functional composition
- 4:18Strategy pattern with lambdas
- 10:41Decorator pattern with functions
- 22:00Execute around method pattern
- 36:13Resource management with lambdas
- 41:35Summary and key takeaways








