title: Decorator pattern: Why do we need an abstract decorator?
body: <p>This question was asked already <a href="https://stackoverflow.com/questions/273943/question-about-decorator-pattern">here</a>, but rather than answering the specific question, descriptions of how the decorator pattern works were given instead.  I'd like to ask it again because the answer is not immediately evident to me just by reading how the decorator pattern works (I've read the wikipedia article and the section in the book Head First Design Patterns).</p>
  
  <p>Basically, I want to know why an abstract decorator class must be created which implements (or extends) some interface (or abstract class).  Why can't all the new "decorated classes" simply implement (or extend) the base abstract object themselves (instead of extending the abstract decorator class)?</p>
  
  <p>To make this more concrete I'll use the example from the design patterns book dealing with coffee beverages:</p>
  
  <ul>
  <li>There is an abstract component class called <code>Beverage</code></li>
  <li>Simple beverage types such as <code>HouseBlend</code> simply extend <code>Beverage</code></li>
  <li>To decorate beverage, an abstract <code>CondimentDecorator</code> class is created which extends <code>Beverage</code> and has an instance of <code>Beverage</code></li>
  <li>Say we want to add a "milk" condiment, a class <code>Milk</code> is created which extends <code>CondimentDecorator</code></li>
  </ul>
  
  <p>I'd like to understand why we needed the <code>CondimentDecorator</code> class and why the class <code>Milk</code> couldn't have simply extended the <code>Beverage</code> class itself and been passed an instance of <code>Beverage</code> in its constructor.</p>
  
  <p>Hopefully this is clear...<em>if not</em> I'd simply like to know <strong>why is the abstract decorator class necessary for this pattern</strong>?  Thanks.</p>
  
  <p>Edit: I tried to implement this, omitting the abstract decorator class, and it <em>seems</em> to still work.  Is this abstract class present in all descriptions of this pattern simply because it provides a standard interface for all of the new decorated classes?</p>