Investigating Legacy Design Trends in C++ & Their Modern Replacements
summary
Compares concrete replacements for legacy patterns: shows classic Singleton, Meyers Singleton, and Monostate examples and argues monostate hides global static state and testing costs remain; demonstrates dependency injection vs factory plumbing and when DI reduces test pain; instruments SFINAE, type_traits and C++20 Concepts to shrink template errors and contrasts CRTP compile-time polymorphism with virtuals and C++23 deducing this, with code samples and compiled-error comparisons to show where newer features actually improve diagnostics or merely shift complexity.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 3:05Global state trends
- 10:51Monostate pattern
- 15:30Dependency injection
- 27:28SFINAE and concepts
- 43:20Polymorphism techniques
- 52:54Multi-level inheritance
- 58:34Design methodologies
- 1:18:45Conclusion and Q&A
related talks
45mWorking with C++ Legacy Code
01h 16mRetiring the Singleton Pattern, Concrete Suggestions for What to Use Instead
49mWorking with C++ Legacy Code
48mEarly Modern C++: How to Handle a C++03 Codebase in $CURRENT_YEAR
43mPatterns of Legacy Displacement
01h 31mClean(er) Code for Large Scale Legacy Applications
47mSave or Reimplement?
43mBeyond Strangler Fig: Effective Patterns for Architectural Modernization
