title: Override variable in subclass in Kotlin
body: <p>I have this super class:</p>
  <pre><code>abstract class Node(rawId: String) {
      open val id: String
      init {
          id = Base64.toBase64(this.javaClass.simpleName + &quot;_&quot; + rawId)
      }
  }
  </code></pre>
  <p>And this subclass that extends Node:</p>
  <pre><code>data class Vendor (
      override var id: String,
      val name: String,
      val description: String,
      val products: List&lt;Product&gt;?
  ): Node(id)
  </code></pre>
  <p>When I initialize the Vendor class like this:</p>
  <pre><code>new Vendor(vendor.getId(), vendor.getGroup().getName(), description, products);
  </code></pre>
  <p>I can see the init block in Node get fired as expected. However, when I get the id from the Vendor object, it is the rawId and not the encoded Id.</p>
  <p>So I am a bit confused about the initialization order/logic in Kotlin classes. I want the encoding code to be common across all subclasses. Is there a better way to do it?</p>