Find number of serialized objects

Posted by tmosier on Stack Overflow See other posts from Stack Overflow or by tmosier
Published on 2010-05-02T19:07:59Z Indexed on 2010/05/02 19:18 UTC
Read the original article Hit count: 142

Filed under:

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?

© Stack Overflow or respective owner

Related posts about Xml