title: What is the best way to support nested object model in java?
body: <p>I need to support UI client which has nested components.  I have come up with below object model - </p>
  
  <pre><code>public class SomeUserInterface { 
          String name;
          List&lt;Component&gt; components;  
  }
  public class Component {
          List &lt;Component&gt; components;  
  }
  </code></pre>
  
  <p>Here, SomeUserInterface will have multiple Components and each Component may have nested Components inside it. 
  Is there any issue in the proposed object model? Or what is the best way to support nested components?</p>
  
  <p>Note : SomeUserInterface and Component are not identical classes. SomeUserInterface can contain Component but vice-versa is not true.</p>