Design Patterns in Scala
summary
Compares classic patterns to concrete Scala constructs and tradeoffs: companion object apply replaces static factory methods, lazy modifier gives thread-safe deferred init, and object implements singletons with on‑demand init. Shows adapters as implicit classes, decorators via traits with abstract override, case classes for value objects, Option instead of null objects, by‑name parameters for Command, partial functions + orElse for Chain, and self types for dependency injection; notes Java interop and pros/cons (conciseness, static checks, some loss of control).
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:39Factory method
- 6:14Lazy initialization
- 9:13Singleton
- 12:00Adapter
- 14:11Decorator
- 18:34Object
- 22:25Null Object
- 25:32Strategy
- 30:53Chain of Responsibility
- 33:56Dependency Injection
related talks
01h 50mObject-Functional Patterns in Scala
39mA few tips on modelling things in Scala
01h 07mBusy Java Developer's Guide to Scala: Basics
48mObject Functional Programming
41mPolymorphism in Scala
42mWhat Scala can learn from Rust, Swift, and C++
49mScala best practices I wish someone'd told me about
19mScala for the Rest of Us
