Hey Stack Overflow'ers,
I'm stuck in a C# program I'm developing, and I think it's because I am taking the wrong approach.
You see, I have these settings in an XML file, which are read at runtime. For each setting, I want to create a new object that does stuff.
I think I can do that, but the problem is, how do I reference those objects?
For example:
<person>
<name>Jared</name>
<age>28</age>
</person>
<person>
<name>Nicole</name>
<age>32</age>
</person>
Normally, I'd just do something like:
Person Jared = new Person();
but I have no idea how many people there will be in the XML file. Then later if I want to set/get Jared's age, I would have no idea how to reference it.
Am I missing how to dynamically create objects using OOP?
-Josh