/** * Implemented by Blueprint Technologies, Inc. */ #include "strategy.h" void main() { Context* context = new Context(); /** * This portion of the code could also * be implemented as an abstract factory * to instantiate the strategy based on some * data external to the program. */ Strategy* strategy = new ConcreteStrategyA(); context -> setStrategy( strategy ); /** * This never changes, even though the stategy used * by it might. */ context -> Operation(); /** * Clean shutdown. */ delete context; delete strategy; }