I've got a solution...it isn't especially pleasant though.

I pretty much implement the singleton code as published.......but use

ISerializable.GetObjectData

To explicitly push the state for the "SingletonSerializationHelper" to
recreate the 'singleton'

It's unpleasant because I have 1 class having to know the internal
structure of another class.....it's a bug waiting to happen.

I don't know what your SingletonSerializationHelper is, but if it is
an implementation of IObjectReference, that's exactly the way it is
supposed to be. In case it's not, an example of this can be found at
http://twoday.tuwien.ac.at/fcs/stories/29226/ .

If you want to avoid having your serialization code split up amongst
two classes (Person and PersonSerializationHelper or whatever), you
could implement it all in the helper class and delegate to it from
within Person.GetObjectData.

Fabian

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

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

Reply via email to