I am looking at implementing http://issues.ops4j.org/browse/QI-260 and
wrote up some documentation first, and would like people to take a
look and see if it makes sense, before I get too deep into the
implementation details.

You find it at; http://www.qi4j.org/qi4j/persistence_cache.html

Key Points;

1. UnitOfWork already has a state and instance cache as a HashMap.
Although the logic is slightly different from what I describe, it felt
natural to plugin to the same concepts.

2. Providing "clone-on-modify" to reduce caching space needed when a
lot of read-only entities are being requested.

I have not scoured the Qi4j runtime implementation yet, but I can
imagine that it might become impossible to provide the global Instance
Cache, since we might have handed out EntityInstances (inside
EntityComposites) within the UnitOfWork in "read-only" which then has
to be 'replaced' with the clone upon modification. If the
EntityComposite handling can't be reached, then it won't work... (I
think)


The Cache and CacheFactory interfaces may evolve when we get into the
implementation details, so I am not looking for exhaustive analysis on
that...


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to