Find number of serialized objects
- by tmosier
Hello all. My issue is trying to determine a number of objects created, the objects being serialized from an XML document. The XML document should be set up for simplicity, so any developer can add an additional object and need no further modification to the code. However each of these objects need to be handled/updated seperately, and specifically, some of the objects are of different sub-classes, which need to be handled differently. Here is some pseudocode for what I am going for
class A
{
public B myClassB;
public void Update()
{
// for every object of whatever type in myClassB
// update logic
}
}
XML:
<\data
<\object1
etc...
So what would be my simplest course of action, allowing other to add objects via the XML, but still ensuring the proper logic happenes for each?