title: Accessing parent class property set by child class
body: <p>I'm trying to access a property from a method in a parent class where that property is initialized in a child class like so:</p>
  
  <pre><code>abstract class Parent {
      String description
      String name
  
      def printDescription() {
          println "description: ${description}"
      }
  }
  
  class Child extends Parent {
      String description = "child description"
  }
  
  Child child = new Child(name: 'Mark')
  child.printDescription()                       // prints "description: null"
  </code></pre>
  
  <p>When the method is executed however, the <code>description</code> property is <code>null</code>. I need to pass the child's <code>description</code> back up to the parent constructor. What is the best way to do that while maintaining grails' auto-generated map constructors? Thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Adding an empty constructor does actually work for what I'm looking for. The constructor is still called when using grails dynamic map constructor, e.g. <code>Child child = new Child(name: 'Mark')</code>.</p>
  
  <pre><code>Child() {
      this.description = "child description"
  }
  </code></pre>