Achieving Loose Coupling with Pure Dependency
summary
A Swift example app called CoffeeShops shows manual Pure Dependency Injection using initializer injection and a single app-target Composition Root layer that composes tiny “composer” getters to build the object graph (credential keychain, SwiftData DB, authenticator, repositories, feature views). Four feature Dev apps (onboarding, map, details, profile) launch isolated features with stop data and mocks, proving the approach works and makes swapping implementations and unit-testable previews trivial.
AI-written summary · about
chapters (13)
- 0:00Introduction to loose coupling
- 1:23Why initializer injection
- 3:04Example app overview
- 5:31Composition root explained
- 8:40Xcode project structure
- 9:22Creating composers in code
- 11:27Profile view composer
- 12:29Mocking dependencies easily
- 13:11Dev apps for features
- 14:36Unit tests and previews
- 15:17Scaling to bigger apps
- 15:57Further learning resources
- 16:20Closing and Q&A
related talks
41mAchieving Loose Coupling with Pure Dependency Injection
43mDependency Injection Pattern for iOS App
19mPractical Structure to Configure Dependency Injection in Swift
43mSwiftUI and DI
26mDependency Management in Clojure
58mA Practical Guide to Loose Coupling
47mSimple Dependency Management in Kotlin
53mRefactor Your Way Forward
