From Problem To Solution
summary
Shows how to turn a sprawling network client into a small configurable core by extracting a RequestBehavior protocol with defaults, an EmptyRequestBehavior and CombinedRequestBehavior, and concrete behaviors like auth‑header and background‑task. Uses protocols, dependency injection and default implementations to remove singletons, cut cyclomatic branches (example: messy client balloons to ~96 tests, an auth behavior has 2 branches), make each behavior independently testable and reusable.
AI-written summary · about
chapters (7)
- 0:00Start
- 2:28cyclomatic complexity
- 4:37what happened??
- 4:49single responsibility principle
- 6:21singletons
- 6:56how to abstract
- 19:04duplication is far cheaper than the wrong abstraction








