The Strategy Design Pattern in Cpp - Mike Shah - C++Online 2024

Опубликовано: 26 Август 2026
на канале: C++Online
2,610
46

https://cpponline.uk/workshops/ 14 Post Conference Workshops Available from £172.50 +VAT. A range of subjects, from beginner to advanced. All include Early Access to C++Online 2026 conference talk videos.
---

The Strategy Design Pattern in Cpp - Mike Shah - C++Online 2024

The strategy design pattern is a fundamental behavioral design pattern allowing clients to control the behavior of an object at run-time. The strategy pattern can be seen in action in the C++ STL for example applying 'policies' to how to execute operations (e.g. std::par or std::seq as one example) -- thus strategy is often known as the 'policy pattern' as well. The strategy design pattern is commonly used to choose the algorithm at run-time to best solve a problem -- separating the algorithmic behavior from the object itself to help make our software more maintainable, extensible, and flexible. In this talk, we will look at a series of C++ examples (starting from scratch) of using the strategy pattern to deploy different algorithms at run-time. We will also look at examples of code in libraries deploying the strategy pattern, and talk about best practices for using the strategy pattern in Modern C++. The strategy pattern will also be compared to the Template Method Pattern, which may be an alternative choice. Attendees will leave this talk with the knowledge to go forward and implement the strategy pattern, as well as how to spot the strategy design pattern in projects they may already be working on!

Slides: https://github.com/CppOnlineConferenc...
---

Mike Shah

Mike is currently an Associate Teaching Professor at Northeastern University in the Khoury College of Computer Sciences. His primary teaching interests are in computer systems, computer graphics, and software engineering. His research interests are related to performance engineering (dynamic analysis), software visualization, and computer graphics.

Along with teaching and research work, Mike has juggled occasional consulting work as a 3D Senior Graphics Engineer in C++. Mike also has a YouTube channel with lots of programming content at:    / mikeshah   . Outside of work, you'll find Mike perfecting the art of making pizza, or otherwise on a run.
---

Streamed & Edited by Digital Medium Ltd - online.digital-medium.co.uk
---

C++Online - The Online C++ Conference organized by Shaved Yaks: https://shavedyaks.com/ & Digital Medium: https://events.digital-medium.co.uk
---

#cpp #cplusplus #cpponline #cppprogramming ---
Work at Hudson River Trading (HRT): https://tinyurl.com/safxfctf