To create a class of a class with an unclassified value, the value-based class must be serializable. So this is actually a design decision not made by you.
If a developer declares a class based on value and implements Serializable , they assume that the classes based on value and Serialization are compatible and will remain so.
We do not know what the final implementation of the value type will look like, but the migration path proposed by the JRE developers, for example. when introducing mandatory lists based on value and serialization , it should be accepted, but not assumed, that there are additional rules and restrictions that go beyond the specification.
After all, there is no reason to believe that serialization will not work with type values. It also supports primitive values ββand has been adapted in the past, for example. when enum support was added. It is not clear whether it will always store values ββthen or still support backlinks, as with ordinary objects, or perform completely different canonicalization, but until you rely on the object identifier, like your premise, you are on the safe side, since any strategy will work with your code.
source share