Applied Modern C++: The problem of messages versioning in API
summary
A concrete Modern C++ system for bidirectional API message versioning is presented: an original CRTP-based C++11 prototype and a refactor using std::variant + std::visit in C++17. Each API version is a struct with version/check/read/write functions and explicit conversion functions chained (shortcuts allowed) so requests upgrade to the latest for computation and responses down‑convert as needed. Demo runs on Compiler Explorer, moves common fields to avoid copies, and is used to serve multiple production versions from a single executable.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:45API versioning challenges
- 3:16Clinical data analysis case
- 8:01API versioning solutions
- 11:38Upgrading message versions
- 16:16CRTP solution in C++11
- 19:11C++17 variant and visit solution
- 32:35Live demo: versioning implementation
- 39:25Lessons learned
- 40:27Q&A
related talks
49mApplied Modern C++: beyond type erasure and visitor pattern
01h 02mUsing Modern C++ to Revive an Old Design
49mEnough TMP to write a Variant
01h 02m“Modern C++ Design (part 1 of 2)”
41mEnough TMP to write a Variant
01h 05mPipeline architectures in C++
01h 02mBreaking Dependencies - The Visitor Design Pattern in Cpp
01h 00mDesign Idioms from an Alternate Universe
