~/talk

Retiring the Singleton Pattern

Talkat Meeting C++ 2019 · 2019-11-14..11-16· [frontend-architecture]
links:none on file
slides:none on file

Argues for removing singletons by replacing them with lightweight wrapper classes, preserving API/source compatibility and allowing a phased rollout across hundreds of call sites (avoids touching 150+ files at once). Uses lazy construction, type erasure via std::function and reference semantics with std::ref, templates for service buckets, and mocks with Google Test so previously opaque functions become testable. Provides concrete refactor steps, handles interdependent initialization, and reports real uptake in production code.

AI-written summary · about

  1. 0:00Introduction
  2. 4:18What is wrong with Singleton patterns
  3. 8:12Why use Singletons
  4. 12:03Refactor Singleton usage
  5. 18:52Testable functions without Singleton
  6. 27:19Phased Singleton replacement
  7. 30:37Initialization dependencies
  8. 37:21Grouping dependencies
  9. 47:49Refactoring benefits
  10. 51:42Question and answer 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.