Seriliasation - OOP issue

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

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?

Thanks.




Responses

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

Up
0
Down
Good Morning Ampo

Please Read the Following articles for Serialization

http://knoge.com/tutorials/desktop-programming/c-sharp/307-c-sharp/439-xml-serialization-in-c.html

http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=236

http://www.switchonthecode.com/tutorials/csharp-tutorial-xml-serialization


http://support.microsoft.com/kb/815813


Thank you for Posting at Dotnetfunda


Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

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

Login to post response