Dependency Management in Clojure
summary
Shows concrete patterns for reducing coupling in Clojure: using higher-order functions and factory closures to inject behavior at setup time, a simple service locator implemented as maps for runtime lookup, and protocols/records for typed dispatch with explicit signatures. Describes Stuart Sierra’s component library to build a start/stop lifecycle graph where dependencies are constructed once and injected, warns about implicit dynamic vars, and recommends keeping functions small and only extracting dependencies that are likely to change.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:14What is this about
- 1:55What are dependencies
- 4:11Explicit vs Implicit
- 7:17Simpleminded
- 7:36Higherorder functions
- 9:25Close over dependencies
- 10:35Service locator pattern
- 12:06Simpleminded library
- 13:26Protocols
- 14:47Summary
- 16:11Stateful dependencies
- 18:23Closures
- 19:19Component
- 21:53Components
- 23:14Dependency Enclosure
- 24:24Suggestions
related talks
41mComponents Just Enough Structure
33m"Consequential Clojure Architectures"
41mAchieving Loose Coupling with Pure Dependency Injection
30mIntroducing structure in Clojure
58mA Practical Guide to Loose Coupling
54mDependency Injection revisited
17mAchieving Loose Coupling with Pure Dependency
01h 28mLaw of Demeter: A Practical Guide to Loose Coupling
