Tag: design pattern
5 posts
-
Design Patterns in Modern C++: What Singleton, Factory, Observer, Strategy and Visitor Look Like After C++17
How GoF patterns change in modern C++: Meyers singleton and its test traps, factory registries, observer re-entrancy, visitor as std::variant, CRTP.
-
The Flyweight Pattern in C++: Sharing Intrinsic State to Cut Memory in Text and Tile Maps
Flyweight in C++: split shared intrinsic state from per-object extrinsic state, with glyph, font and tile-map examples and the mutation and cache-growth traps.
-
The Facade Pattern in C++: One Simple Interface over a Messy Subsystem, and What It Hides
C++ Facade pattern: wrap a complex subsystem behind one simple interface, with multimedia, build-pipeline, and database examples, plus the tradeoffs of hiding subsystems behind one API.
-
The Bridge Pattern in C++: Splitting Abstraction from Implementation to Avoid Class Explosion
C++ Bridge pattern guide covering how separating abstraction from implementation prevents class explosion, with renderer switching, cross-platform file system, and common pitfalls.
-
The Composite Pattern in C++: Tree Ownership, Transparent vs Safe Designs and the LSP Problem
The Composite pattern in C++: treating leaves and containers uniformly, choosing raw pointers, unique_ptr or shared_ptr for ownership, file system and UI examples, and the transparent vs safe design trade-off.