title: "Creator" pattern to configure inherited objects
body: <p>I have the following object structure:</p>
  
  <pre><code>class Annotation;
  class LabelAnnotation: inherits Annotation;
  class TextAnnotation: inherits LabelAnnotation;
  </code></pre>
  
  <p>I would like to use "creator" objects to do some initialization on these object (This initialization depends on external settings so I don't want to do it in the constructor of these objects.)</p>
  
  <p>In particular, when creating a LabelAnnotation I would like to do:</p>
  
  <pre><code>fontSize = AppDefaults.fontSize
  </code></pre>
  
  <p>So I'm writing a "creator":</p>
  
  <pre><code>class LabelAnnotationCreator {
      LabelAnnotation create() {
          annotation = LabelAnnotation()
          annotation.fontSize = AppDefaults.fontSize
          return annotation;
      }
  }
  </code></pre>
  
  <p>Now, I would like to create a TextAnnotationCreator. This is where I'm stuck: I can't use the LabelAnnotationCreator because it would create an instance of a LabelAnnotation, but on the other hand, I want to benefit from the initialization performed by the LabelAnnotationCreator.</p>
  
  <pre><code>class TextAnnotationCreator {
      TextAnnotation create() {
          annotation = TextAnnotation()
          // I'm stuck here:
          // can't do LabelAnnotationCreator().create()… ???
          return annotation;
      }
  }
  </code></pre>
  
  <p>Obviously, this isn't the right pattern but I'm not sure how to find the correct one.</p>
  
  <p>Thanks!</p>