c# parent child design
<p>I am designing a c# class and would like to know if my design is right.</p>

<pre><code>abstract class PersonBase
{
    public string Name { get; set; }
    public PersonBase Parent { get; set; }
    public List&lt;PersonBase&gt; Children { get; set; }

}

class Person : PersonBase
{
    //public override List&lt;Person&gt; Children { get; set; }

    public Person()
    {
        Children = new List&lt;PersonBase&gt;();
    }

    public void Add(Person child)
    {
        child.Parent = this;
        Children.Add(child);
    }
}
</code></pre>

<p>test code:</p>

<pre><code>private void button1_Click(object sender, EventArgs e)
{
    Person parent = new Person();
    parent.Name = "parent";

    Person child = new Person();
    child.Name = "child1";
    child.Add(new Person() { Name = "grandchild1" });

    parent.Add(child);

}
</code></pre>

<p>It works as expected. I am able to access the parent children objects from anywhere in the hierarchy. My concern is it looks recursive or circular reference (can't find the right word here).</p>

<p>Here is what I did finally:</p>

<pre><code>public class Person
{
    public string Name { get; set; }
    public Person Parent { get; set; }
    public List&lt;Person&gt; Children { get; private set; }

    public Person()
    {
        Children = new List&lt;Person&gt;();
    }

    public void AddChild(Person child)
    {
        if (child == this) { return; }
        if (Children.Contains(child)) { return; }

        child.Parent = this;
        Children.Add(child);
    }
}
</code></pre>
