Java: versioned data structures?

前端 未结 6 2600
别那么骄傲
别那么骄傲 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:31

    Either do as you already suggested, or have a base class of some sort with subclasses that represent the different changes. Then get the proper class at run-time by passing the version/timestamp/whatever to a factory that hands you back the right one.

提交回复
热议问题