Hi All,
I hope i am posting in the right forum as i am looking for a .Net related solution rather than a pure XML solution.
I have the following class which i serialise using default XML serialisation.
Class UserA
UserID
UserName
Description
Comments
End Class
Later, my requirements changed and i had to generate 2 views of the same data.
In my 1st view, i would generate XML for the whole object (all 4 properties)
My 2nd view - include only UserID and UserName.
i modified the code as below
Interface iUser
UserID
UserName
End Class
Class UserA
Implements iUser
UserID implements iUser.UserID
UserName implements implements iUser.UserName
Description
Comments
End Class
I intended to serialise appropriate objects (iUser or UserA) based on my view requirements.
Unfortunately, i realised that XML serailisation does not work on interfaces - end to my dreams of getting it easy:(
My question is - if i have an Object instance, can i use any feature with serialisation to generate multiple views of an object?
I have ventured towards creating seperate classes, ISerializable, etc.
looking for suggestions on whats the best way to take this forward.
Thanks in advance.
modified on Thursday, August 13, 2009 4:23 AM