RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.58k stars 248 forks source link

Documentation regarding @Version annotation #302

Open chrisco484 opened 4 years ago

chrisco484 commented 4 years ago

The comment in the Version annotation source file says:

support for adding fields without breaking compatibility to old streams.

  • For each release of your app increment the version value. No Version annotation means version=0.

This second line of this comment lead me to believe that versioning is 'per stream' but I believe that the version stored in the stream is stored 'per class' (or maybe per object) and not 'per stream' (as it would be if the versioning was at stream/application level).

We have only incremented the @Version number assuming there is a 'per class/object' version and that seems to be working. This means that we treat each class hierarchy as having it's own independent versioning i.e. there is no 'app scope' versioning.

Have we made the right assumption?