title: Decorator pattern member variable
body: <p>I am implementing my first Decorator pattern. The base class which I want to decorate has a member variable initialized in the constructor. The decorated class also has this member variable (since it is a descendant of the base class). My question is, should I initialize this member variable in the decorated class too, or use the member variable of the base class (which lives inside the decorated class)?</p>
  
  <p>Here is some code. I'm just curious whether Decorated1 or Decorated2 is better?</p>
  
  <pre><code>public class Base{
  private String memberVariable;
  public Base(){
      memberVariable = "";
  }
  public Base(String s){
      memberVariable = s;
  }
  public String Description(){
      //code here
  }
  }
  
  public abstract class BaseDecorator(){
  public abstract String Description();
  }
  
  public class Decorated1 extends BaseDecorator{
  Base b;
  public Decorated1(Base _b){
      b = _b;
  }
  public String Description(){
      //code here
  }
  public String getMemberVariable(){
      return b.getMemberVariable();
  }
  }
  
  public class Decorated2 extends BaseDecorator{
  Base b;
  public Decorated1(Base _b){
      super(_b.getMemberVariable());
      b = _b;
  }
  public String Description(){
      //code here
  }
  public String getMembervariable(){
      return memberVariable;
  }
  }
  </code></pre>