title: A Strategy against Policy and a Policy against Strategy
body: <p>When I first discovered the Strategy pattern, I was amazed of the seemingly endless possibilities it offered to me and my programs. I could better encapsulate my models' behaviour and even exchange this behaviour on the fly. But the strategy could also be used to to provide traits and payload to the containing object - data that was declared in a superclass. Life was fine.</p>
  
  <pre><code>class MyMonsterAI   { float const see_radius_; virtual void attack () = 0; /* .. */ };
  class ElveAI        { ElveAI() : see_radius_(150.0f) {} /* ... */ };
  class CycloneAI     { CycloneAI() : see_radius_(50.0f) {} /* ... */ };
  class Monster       { MyMonsterAI* ai_; };
  </code></pre>
  
  <p>And along came the Policy pattern and it would allow me even greater flexibility in supplying parameters to a containing class - whole classes, outfitted however I liked, albeit dynamically exchanging the behaviour... that was not too easy (unless part of the policy was to have a strategy!).</p>
  
  <pre><code>class MyMonsterTrait { typedef typename ElveAI AI; };
  
  template&lt; class MonsterTrait &gt;
  class Monster : public MonsterTrait::AI
  {
      void idle (void) { attack(); }
  };
  </code></pre>
  
  <p>Both patterns seem to be very powerful to me and I like to use both, in different circumstances. But I'm not sure if there are particular/typical/more-practical applications for either at some situations.</p>
  
  <p><strong>I am wondering: where do you use strategies and where policies? Where are either better suited?</strong> </p>