~/talk

Dependency Injection in C++ - A Practical Guide

Talkat C++Now 2024 · 2024-04-29..05-03· [software-architecture, testing]
links:none on file
slides:none on file

Compares concrete DI techniques applied to a large legacy ticker‑processing codebase and shows which actually work: link-time substitution is brittle and abandoned; interfaces, templates and std::function are used with Google Mock and C++20 concepts; null objects and small base functional classes reduce test scaffolding; extracting eight responsibilities into three layered components cuts injection points dramatically; lazy initialization is solved by a provider function passed with a default to preserve ABI; prefers constructor injection over setters and globals.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 3:30Dependency injection myths
  3. 7:46Ways to inject functionality
  4. 11:43Inheritance and virtual functions
  5. 16:40Template-based injection
  6. 21:58Type eraser and function objects
  7. 24:45Null-valued objects for testing
  8. 26:13Setter and method injection
  9. 30:13Constructor injection
  10. 32:21Conceptual dependency injection
  11. 33:44Applied dependency injection
  12. 48:50Roadblocks in legacy code
  13. 51:21Refactoring for dependency injection
  14. 1:02:16Encapsulated functions
  15. 1:05:48Lazy object initialization
  16. 1:14:23Unexpected snags in legacy code
  17. 1:19:44Truth about dependency injection
  18. 1:22:14Final thoughts and Q&A
~/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.