Patterns in the Wild
Resource pools (connection, thread, object, monitor, and active object), shortcut patterns such as function-pointer tables and dispatch maps, and anti-patterns to recognize and avoid.
Resource pools
A generic, bounded resource pool with an RAII lease handle, taught against a shipment-tracking connection pool, plus three sibling concurrency shapes from the same domain: a thread pool rendering shipping labels, a monitor object, and an active object.
Shortcut patterns: dispatch tables and maps
Three lightweight alternatives to a full Strategy, State, or Command class hierarchy, taught against a shipment-tracking ingestion service: an enum-indexed function-pointer table (the classic jump table), a std::unordered_map dispatch map for an open, runtime-extensible set, and a constexpr std::array table checked complete at compile time.
Anti-patterns and pattern misuse
Recognizing patternitis in a shipping codebase: a singleton configuration registry holding global mutable state, a factory-of-factories wrapped around interfaces with one implementation each, a god object that validates, logs, and formats, and a leaky abstraction that exposes its own call order. The simplified rewrite collapses six types into one class and two plain values, computes the same answer, and is testable where the original was not.