title: Strategy Pattern V/S Decorator Pattern
body: <p>I just came across two patterns.</p>
  
  <ol>
  <li><p>Strategy Pattern</p></li>
  <li><p>Decorator </p></li>
  </ol>
  
  <blockquote>
    <p>Strategy Pattern :-</p>
    
    <p>Strategy pattern gives several algorithms that can be used to perform
    particular operation or task.</p>
    
    <p>Decorator Pattern :-</p>
    
    <p>Decorator pattern adds some functionality to component.</p>
  </blockquote>
  
  <p>In fact I have found that <strong>Strategy</strong> Pattern and <strong>Decorator</strong> Pattern can also be used interchangeably.</p>
  
  <p>Here is the link :-
  <a href="https://stackoverflow.com/questions/4354611/when-and-how-strategy-pattern-can-be-applied-instead-of-decorator-pattern">When and How Strategy pattern can be applied instead of decorator pattern?</a></p>
  
  <p><strong>What is the difference between Strategy Pattern and Decorator Pattern?</strong></p>
  
  <p><strong>when Strategy Pattern should be used and when Decorator Pattern should be used?</strong></p>
  
  <p>Explain the difference between both with the same example.</p>