Re: persistence/serializable

"Nassar, Anthony" <[email protected]> Tue, 27 Mar 2007 15:31:31 -0400
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
Does anyone know how a way to do this w/o having Component implement
IXmlSerializable? Since nearly every member of that class that you want
to serialize has an acceptable default XML serialization, it shouldn't
be too hard. The only alternative that comes to mind is to use a custom
collection, and *not* ArrayList; then implement IXmlSerializable for
that class (i.e., just write out the names of the Step objects, and just
read those back in. Then the enclosing instance of Component would have
to resolve those references, though, which takes you back to
implementing IXmlSerializable for Component).

This is why I don't like to make classes serializable. Usually I've got
a "memento" class that the real class can instantiate, or populate
itself from. I design the memento in order to be trivially serializable.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com