~/talk

Dependency Injection in C++ - A Practical Guide

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [c-and-cpp, testing]
links:none on file
slides:none on file

Practical strategies for adding DI to a legacy C++ ticker-plant: rejects link-time substitution (avoid), compares inheritance/virtual interfaces, templates and std::function/type erasure, and shows Google Mock usage and null-object stubs. Addresses injection styles (setter/method/constructor), lazy construction via a dependency-provider callable, and signature-preserving forwards/defaults for APIs. Demonstrates refactoring god classes into gather/apply/distribute tiers, fixes a 167-method interface pain point, cuts heavy inheritance code by about 60%, and applies changes in production without feature flags.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 3:01Myths and current testing
  3. 6:06Essence of DI and system analysis
  4. 8:36Basic injection methods
  5. 14:13Advanced injection techniques
  6. 20:16Stubs and null objects
  7. 23:08Setter and method injection
  8. 25:55Constructor injection
  9. 28:09Conceptual and applied DI
  10. 31:06Refactoring strategies
  11. 38:15Managing complex dependencies
  12. 43:43Legacy code techniques
  13. 50:25Conclusion and final insights
~/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.