Policy-based Design

  • A Policy-based Design is very often used within Loki.
  • Policy classes are small self-contained implementations for specific behaviors.
  • Many of them are interchangeable which allows users to choose exactly which policies they wish.

See also

Aspect-oriented Programming

  • Policy-based Design is related to AOP. The two techniques complement each other:
    • Policy-Based Design creates one distinct type for each particular choice of hooks (e.g., in one application you can have smart pointers that perform check on dereference, as well as smart pointers that don't check on dereference; they have different static types);
    • AOP hooks a type in a uniform way (e.g., all of the smart pointers in an application will be checked or unchecked depending on the aspect chosen)
  • Wikipedia on Aspect-oriented Programming
  • AOP with templates: see examples in this presentation of AspectC++