title: Alternatives to decorator pattern
body: <p>I find decorator pattern to be most confusing. Please consider the example provided in "Head first design patterns book".</p>
  
  <p><img src="https://i.stack.imgur.com/mBVGy.png" alt="alt text"></p>
  
  <p>So to get a <em>DarkRoast</em> with double mocha and a whip, you have to write</p>
  
  <pre><code>Beverage beverage2 = new DarkRoast();
  beverage2 = new Mocha(beverage2);                                       
  beverage2 = new Mocha(beverage2);                                       
  beverage2 = new Whip(beverage2); 
  </code></pre>
  
  <p>I feel this is unnecessary. Here is my implementation,</p>
  
  <pre><code>interface Beverage
  {
     int Cost();
  }
  
  class DarkRoast : Beverage
  {
     /* .... */
  }
  
  class Mocha : Beverage
  {
     /* .... */
  }
  
  class Whip : Beverage
  {
     /* .... */
  }
  
  // here is the changed part
  class Order
  {
      List&lt;Beverage&gt; beverages = new List&lt;Beverage&gt; beverages();
      public void AddItem(Beverage b)
      {
          beverages.Add(b);
      }
  
      public int Cost()
      {
          int cost;
          foreach(Beverage b in beverages)
              cost += b.Cost();
      }
  }
  
  // use it like
  Order order = new Order();
  order.AddItem(new DarkRoast());
  order.AddItem(new Mocha());
  order.AddItem(new Mocha());
  order.AddItem(new Whip());
  int cost = order.Cost();
  </code></pre>
  
  <p>IMO, both does same. If yes, what is the advantage of using decorator pattern here?</p>
  
  <p>Any thoughts?</p>