~/talk

Dependency injection is your friend

Talkat EuroPython 2011 · 2011-06-20..06-26· [python, software-architecture]
slides:none on file

Argues that explicit dependency injection wins in Python by enforcing interfaces, reducing brittle tests from monkeypatching, and removing tangled construction order. Shows a small Python DI library with constructor injection, an application context that registers provider methods, a lazy singleton scope and provider-decorated factory functions. Demonstrates wiring a DB driver → user repository → user service, keeps configuration declarative so imports and instantiation order vanish, and reports the library works for real projects while avoiding setter/field injection and decorator-based clutter.

AI-written summary · about

  1. 0:00Introduction
  2. 1:37Dependency injection and SOLID
  3. 3:04Misconceptions about DI
  4. 6:00Programming to interfaces
  5. 9:15Constructor injection and encapsulation
  6. 12:30Interfaces vs implementation
  7. 15:02Redefining encapsulation
  8. 17:14Component design and wiring
  9. 18:58Simplifying code with DI
  10. 21:05Testing pitfalls and refactoring
  11. 23:57Constructor injection benefits
  12. 25:26Project showcase and feedback
  13. 26:30Encapsulation and abstraction
  14. 33:50Configuration and dynamic building
  15. 37:48IOC containers and resolution
  16. 40:12Declarative configuration
  17. 41:57Application context and retrieval
  18. 42:19Python DI libraries comparison
~/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.