This is a general best practice question about creating parent / child relationships with objects. 

Let's say I have Wheel and Car objects and I want to Add a Wheel object to car object

```
public class Car{

    private List<Wheel> wheels = new List<Wheel>();

    void AddWheel ( Wheel WheelToAdd)
        {
            wheels.Add(WheelToAdd)
            //Some Other logic relating to adding wheels here
        }
    }
}

```

So far so good. But what if I want to have a Car property of my wheel to say which parent car it relates to. Something like this

```
 public class Wheel {

     private Car parentCar;
     public Car 
     {
        get
        {
         return parentCar
        }

  }

}

```

When adding the wheel to the car, at which point would you set the parent property of the Wheel? You could set it in the Car.AddWheel method, but then the Car Property of the Wheel object would have to be Read/Write and then you could set it outside of the AddWheel method, creating an inconsistency.

Any thoughts, many thanks in advance
['https://Stackoverflow.com/questions/3875021', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/425095/']
You might want to consider having a setter that only sets `Wheel.parentCar` if that setting is null, but only if you're able to assume that your first setting will be valid and are thus able to disregard any other attempts.

Edit: but yes, that would be the proper place to add the `Car` object. You could also do a check such that you create (for example) `Wheel.validateCar(Car carInQuestion)`, where it enforces that the `parentCar` property is only set where the current `Wheel` object exists in `Car`. This implies that you would have a public method for searching `Car.wheels` for membership based on a particular instance of a wheel. But that's only if you really feel the need to be strict.
Take a look at [Is it bad practice for a child object to have a pointer to its parent?](https://stackoverflow.com/questions/3724092/is-it-bad-practice-for-a-child-object-to-have-a-pointer-to-its-parent)