tags:

views:

28

answers:

1

hi, guys. I'm not asking here a particular question. The question is: what is your opinion on .NET IExtensibleDataObject interface and the whole mechanism used in terms of stability? Have you used it? Is that a reasonable solution if I suspect that my business object shall morph with time? It seems that it can support new members in new versions of a class, but it seems that IExtensibleDataObject class implementation is NOT stable to the changes to old member types. May be you have some criticism about this mechanism and I will be glad to hear it.

A: 

It does its job, which is to allow you to safely round-trip unexpected data without loss. Allowing old clients to talk to new servers, and new clients to talk to old servers.

Re "changes to old member types"; if you mean you've changed the definition of an existing member, then frankly all bets are off. Most serializers work on a contract (implicit or explicit) about the data. If you change a member, you have broken the contract.

It is generally better to replace a member rather than change it; or better - version the entire DTO (i.e. release a new contract, that is independent to the original).


Actually, my biggest gripe about this interface is that it deals with a concrete implementation (ExtensionDataObject). But that is more related to my specific whims, from the perspective of someone who maintains a serialization utility library...

Marc Gravell
Well, it seems that this scenario does not work for my problem. I have settings serialized to disk and have dialog box for modifying these settings bound through binding source. So, suppose at first I bound it to ObjectVersion1, entered data and serialized it to myfile.dat. Then I updated databindings to ObjectVersion2 to edit additional fields in this new object. If I try now to deserialize myfile.dat with its ObjectVersion1 instance, databinding will fail due to the fact, that some member values are not present in ObjectVersion1 (in Members of ExtensionObject field).
Nickolodeon
@user480391 Are those members marked as optional?
Marc Gravell