Managing several versions of serialized Java objects

前端 未结 4 765
野趣味
野趣味 2020-11-30 05:44

Lets say that I have a program that for some reason need to handle old versions of serialized objects.

Eg: when deserializing, one of these versions may be encounter

4条回答
  •  情深已故
    2020-11-30 06:01

    You do not have to maintain multiple version of the class. The latest version should be sufficient. See the link 5 things you don't know about Serialization specifically "Refactoring Serialized Class"

提交回复
热议问题