Components Just Enough Structure
summary
Describes a tiny Clojure library that models stateful pieces as immutable records/maps and wires them into a system map that does a dependency graph and topological sort to call a start/stop lifecycle on each component, returning updated components. Uses associative injection so tests swap DB/email stubs by assoc before start, supports protocol-based stubs and per-test fresh databases, is implemented with a few helpers (update-system, reverse), works in practice and helps split monoliths, but cannot start/stop partial systems at runtime.
AI-written summary · about
chapters (27)
- 0:00Intro
- 2:31Structure Built-In
- 3:13Not a Lot of Structure
- 4:47One Big Map
- 8:24State Wrapper
- 9:33Public API
- 10:24Lifecycle: Constructor
- 11:03Lifecycle: Transitions
- 12:45Service Provider
- 13:56Domain Model
- 16:37Constructor with Dependencies
- 17:49System Map
- 19:13Starting a System
- 22:16Associative Injection
- 23:19Stub Service for Testing
- 24:30DB for Testing
- 25:37Testing Business Logic
- 27:07Var Substitution & Asynchrony
- 29:54Entry Point: main
- 30:16Entry Point: JSVC
- 30:50Entry Point: Web Request
- 31:40Inject Components Into Routes
- 32:28Web Server Component
- 33:23Tricks & Extensions
- 34:58System Lifecycle
- 36:07Merging Systems
- 38:47Disadvantages
related talks
26mDependency Management in Clojure
30mIntroducing structure in Clojure
33m"Consequential Clojure Architectures"
30mGrowing Clojure Systems. From Functions to Microservices
43mEvident Code, at Scale
24mBuilding Intelligible Systems
43mThe Tyranny of Structurelessness
01h 42mBuilding Marvelous and Heroic Systems from the Ground Up
