~/talk

Achieving Loose Coupling with Pure Dependency Injection

Talkat Swift Connection 2023 · 2023-09-21..09-22· [software-architecture, swift]
links:none on file
slides:none on file

Argues that Pure Dependency Injection plus a central Composition Root in the app target produces loose coupling; shows a SwiftUI iOS app split into feature Swift packages, uses initializer injection with protocol-based repositories, and wraps SwiftData behind a CoffeeShopsRepository. Composers are properties/functions that create object-graph subtrees with singleton, scope, and transient lifetimes. Builds four dev app targets that launch single features, keeps previews and unit tests working, and demonstrates swapping implementations (e.g., mock or Core Data) without breaking consumers.

AI-written summary · about

  1. 0:00Introduction to DI
  2. 1:32App walkthrough
  3. 3:53Dependency injection basics
  4. 6:11Types of injection
  5. 8:21Understanding object graphs
  6. 10:18Modularization with packages
  7. 12:04The composition root pattern
  8. 14:16Implementing composers
  9. 18:34App target implementation
  10. 21:22Lifetimes and routing
  11. 24:30Previews and composition
  12. 28:23DI in unit testing
  13. 30:05Dev apps and conclusion
  14. 32:13Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.