title: Decorating a class whose constructor has parameters?
body: <p>I am using the decorator pattern and am decorating a class with a constructor that has parameters.</p>
  
  <p>Below is the constructor of the class decorating;</p>
  
  <pre><code>Public Sub New(ByVal repository As ISchedulingRespository)
  
    Me.repository = repository
  
    End Sub
  </code></pre>
  
  <p>Because my decorator class inherits from the decorated class I need to declare it's constructor as follows;</p>
  
  <pre><code> Public Sub New(ByVal schedulingService as SchedulingService, ByVal repository As ISchedulingRespository)
  
          MyBase.New(repository)
          Me.instance = instance
     End Sub
  </code></pre>
  
  <p>So when I create the decorator class I pass in an instance of the class decoratoring as well as the parameter required for the class going to decorate. This can be seen below;</p>
  
  <pre><code> Dim schedulingServiceDecorator As New SchedulingServiceEventDecorator(schedulingService, schedulingRepository)
  </code></pre>
  
  <p>This does not seem correct to me. Am I missing something with this pattern?</p>
  
  <p>I could simply not pass in the decorating class in the decorator constructor, but every article seen on this pattern passes an instance of the class being decorated, into the decorator.</p>
  
  <p>Is this a case of modifying a pattern to meet your needs?</p>
  
  <p>Many Thanks</p>