Rafactoring vs. serialization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?=

    Rafactoring vs. serialization

    Hi,

    I serialize data using a binary formatter. However, If I need to rename the
    field of one of the serialized data, I cannot reload the file - reflection is
    causing this I'm sure. However, is there a way to rename data within a binary
    serialized file.

    regards JEsper
  • Marc Gravell

    #2
    Re: Rafactoring vs. serialization

    I suspect you'd need to use a "serializat ion surrogate", which is a
    lot of work. Note that serializers like DataContractSer ializer,
    XmlSerializer, etc allow you to control serialization names separately
    - so you can have:

    [DataMember("bar ")]
    private string foo;

    in terms of serialization, it is called "bar", but you can re-factor
    the code to "foo"...

    Some other 3rd-party serializers (like protobuf-net) don't use names
    at all.

    Marc

    Comment

    Working...