Best way to update serialized database objects after changing object shape

I often write my objects to the database in xml form.

However, if I change the shape of my objects, say by changing the name or changing the fields, I can no longer read them from the database, which makes it difficult to read them, convert them to a new form and write them back to the database.

I would rather not rename my classes every time I change something.

* Note. I rely on C # XmlSerialization / Deserialization objects to generate Xml. Perhaps this is undesirable if I change the format of the objects.

+3
source share
2 answers

ISerializable , /, .

. , : ISerializable

+2

, .

- ( -). , Dog, name, breed, . breed = nil.
( xml, json ) , , .

, - , .

+1

Source: https://habr.com/ru/post/1792857/


All Articles