2 ms·
Coming up with a format which is independent of your in memory structure can be limiting in some situations. A successful strategy is to isolate key persistable
by osigurdson 8y ago
Coming up with a format which is independent of your in memory structure can be limiting in some situations. A successful strategy is to isolate key persistable types in a manner that allows you to carry the old types into later versions of your application at minimal cost. This allows you to deserialize the data in its exact original form. From this point a series of transforms are used to map the data to the current version of the application. The nice thing about this strategy is it is entirely additive - transforms are added as required and chained together and old transforms are never mutated. Having said this, if you can get away with defining your data structure up front, by all means do it as there are many advantages to doing so. If you cannot (unknown requirements, large team, etc) then a more rigorous transform chain approach can be a reasonable option.