Policy-based design — assembling behaviour at compile time
Alexandrescu-style policy classes: compose behaviour from interchangeable compile-time policies instead of runtime switches. Zero overhead, no virtual dispatch, unlimited configurability.
Alexandrescu-style policy classes: compose behaviour from interchangeable compile-time policies instead of runtime switches. Zero overhead, no virtual dispatch, unlimited configurability.
How type erasure works in C++. std::function internals, std::any, hand-rolled type erasure with a storage buffer — when each approach is worth the complexity.
Encapsulating operations as objects. Undo/redo stacks, macro recording, deferred execution queues — with a Qt UI example.
Structuring C++ firmware into HAL, driver, service, and application layers. Enforcing layer boundaries so hardware changes don't ripple into business logic.
How to decouple firmware modules with an event bus. Pub-sub without an RTOS, ISR-safe event posting, and the tradeoffs of event-driven vs direct-call architecture.
Safe async design with the active object pattern. A thread and its message queue encapsulated in one class — no shared state, no locks on the hot path.
Centralising object creation in C++. Factory method vs abstract factory, fluent builders, and how these patterns interact with dependency injection and testing.
How the Curiously Recurring Template Pattern enables zero-cost abstraction, compile-time interfaces, and mixin composition without virtual dispatch.
Runtime and compile-time strategy in C++. Eliminating if-else chains with virtual dispatch, template parameters, and CRTP. When each approach costs what.
Enum + switch, table-driven, and state-object FSMs compared. With embedded firmware context and a worked example of a connection manager.
Pure virtual classes, designing contracts that hold under substitution, and how interface-based thinking changes the way you write testable C++.
Constructor injection, service locator tradeoffs, and how to wire a C++ application without pulling in a DI container.
A practical src/include/lib/test layout with clean CMakeLists files. How to avoid the monolith, enforce layer boundaries, and keep build times sane.
Each SOLID principle illustrated with real firmware code. What violations look like, how to fix them, and why it matters on a microcontroller.