Java: versioned data structures?

前端 未结 6 2534
别那么骄傲
别那么骄傲 2021-02-20 13:24

I have a data structure that is pretty simple (basically a structure containing some arrays and single values), but I need to record the history of the data structure so that I

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 13:50

    You should use some form of persistent data structure that is immutable and is based on structural sharing (i.e. so that the parts of the data structure which do not change between versions only get stored once).

    I created an open source Java library of such data structures here:

    http://code.google.com/p/mikeralib/source/browse/#svn/trunk/Mikera/src/mikera/persistent

    These were somewhat inspired by Clojure's persistent data structures, which might also be suitable for your purposes (they are also written in Java).

提交回复
热议问题