Abstracting a set of functionalities into a class which provides a higher level interface often requires tough design decisions. Users who do not have the exact requirements for which the abstraction is optimized will suffer a syntactic or run time overhead as a result.
Alexandrescu's famous "policy-based design" provides a mechanism to allow the user to extend and customize an existing abstraction in order to fine-tune its functionality for many different use cases. This is however limited to use cases where each policy more or less represents a compile time strategy pattern.
Alas, not everything is a strategy pattern. In this talk I will explore the viability of a more agent-pattern-like paradigm where each policy knows its requirements and publishes its capabilities. In this paradigm, glue code connecting any valid set of policies is automatically generated using template metaprogramming. This allows much more powerful customizations while maintaining static linkage.
YOU MAY ALSO LIKE:
- Advanced Clojure (in London on 20th - 21st September 2018)
- CloudNative London 2018 (in London on 26th - 28th September 2018)
- Well-Typed's Guide to the Haskell Type System (in London on 10th October 2018)
- Well-Typed's Guide to Haskell Performance and Optimization (in London on 15th - 16th October 2018)
Agent based class design, C++ with a robot glue gun
Odin spent much of his career doing electronic engineering work including programming micro controllers. At one point he got fed up with popular design practices and the technology stack in the embedded domain and decided to try to fix it. As it turns out that rabbit hole is deep and it leads to C++ template metaprogramming.