I just mean the whole "value" Attribute declaration and the copyWith()
stuff in the specific BitemporalWrapper and the "hists" Attribute
declaration and getHists() stuff in the "Anchor".
I found a way now to generalize this stuff and put it in 2 abstract
superclasses "AbstractBitemporalModelWrapper" and "AbstractAnchor" so
the specific implementaions only have to contain one codeline. I will
happily share these when I find the time.
But, as always there is another question ahead, and a important one I
think it is:
As my last step of testing DAO Fusion history I did some performance
anaylsis and found it shocking that the whole bitemporal trace is
read, as soon as one get() order gets to the holder of the trace, the
Anchor.
Okay, you can limit the amount of read data by putting the value
Attribute in the BitemporalWrapper on Lazy fetch, but still then there
are 2 Intervals read for every Bitemp.
Imagening a szenario where timelines of objects have grown to hundreds
of Validities and also hundreds of Revisions, this can be a killer to
performance and maybe even heap size.
Having some experience with a custom made history implementation, I
know that they reversed their relations between Anchor and Bitemp, so
that the Bitemp knows his Anchor, but the Anchor has no List of
Bitemps, to exactly avoid the mentioned szenario. This of course has
other pitfalls. You basically loose all JPA Entity Cache advantages
and you manage your historic gets directly on the DB with Select
queries.
I found your idea of working directly on a List of persited, cached
Bitemps nice and easy to understand, but if the cost of it is to
always have to load the entire history of an Object, I don't believe
that it can be used in real applications.
But lets see first what you think and if I maybe missed some important
point, e.g. smart loading the history trace via some spectacular
Hibernate Annotation, before dragging on too long on the topic.
On Mar 7, 5:46 pm, Igor Mihalik <
igor.miha...@gmail.com> wrote:
> The bitemporal code has origins in the work of ervacon and with their
> permission we were able to include the source and enhance it to use
> JPA/Hibernate annotations instead of xml mapping files. You can find
> the original code here:
https://svn.ervacon.com/public/projects/bitemporal/
>
> Regarding your question, what kind of simplifications do you have in
> mind? It would definitely be a positive step forwards to simplify the
> implementation and get rid of any boilerplate code. If you have any
> idea feel free to create your fork of the project, currently it's also
> hosted onhttps://
github.com/igm/daofusionand send pull request if