Seriliasation - OOP issue

Posted by Ampo under C# on 8/27/2009 | Views : 1279 | Status : [Member] | Replies : 1

I have class "A" that needs to creat another class "B".
In one case, class "B" needs to have one attribute/field and in another case two attributes/fields.

I thought to split class "B" into two classes "C" and "D" that one will have one attribute ant the other one two. constructor of "A" will know which to create.

so far - so good.

now I need to serialize the whole thing.
in the output xml, "C" or "D" must have the same node name.

How can I do this?
Any other options I have?



Posted by: Vuyiswamb on: 8/31/2009 [Member] [MVP] [Administrator] NotApplicable

Good Morning Ampo

Please Read the Following articles for Serialization

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda

Ampo, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response