Temporal libraries for Java [closed]

核能气质少年 提交于 2019-12-03 17:47:53

问题


I'm looking for temporal libraries for Java, i.e. libraries which allow to store multiple historical version of the same concept. I'm looking for a library which has an API to do something like:

Instant i1 = Instant.valueOf("2010-01-01");
Instant i2 = Instant.valueOf("2010-01-02");
Attribute<String> a =  ....
a.setValue(i1, "String as of 2010-01-01");
a.setValue(i2, "String as of 2010-01-02");

You can find a discussion about temporal issues on the nice articles by Martin Fowler

One library I found is JTemporal, which seems pretty good to me, but it's not complete and lacks support for Hibernate persistance. I'd like support for temporal sets too, i.e. sets defined in an exact point in time. JTemporal does that, but persisting the TemporalSet is not easy.


回答1:


Have a look at DaoFusion framework which acts as a bitemporal framework with tight integration into Hibernate. It should be exactly what you are looking for.

Quoted from the linked website:

Bitemporal pattern offers an elegant and sophisticated way of dealing with most temporal issues. The bitemporal pattern implementation offered by DAO Fusion builds upon a bitemporal framework created by Erwin Vervaet and Christophe Vanfleteren. You can learn more about this framework from their presentation Temporal Issues in a Rich Domain Model.




回答2:


Look at Deuce STM - Java Software Transactional Memory.



来源:https://stackoverflow.com/questions/4018915/temporal-libraries-for-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!