[hibernate-dev] org.hibernate.cache redesign

Steve Ebersole steve at hibernate.org
Wed Mar 28 16:07:38 EDT 2007


So I am in the midst of redesigning the stuff in the org.hibernate.cache package 
as we discussed previously during our last roadmap discussion.  This is work I 
will commit to trunk, but not to Branch_3_2 and which will start the 3.3 
development line since it will require significant SPI changes.

So I just wanted to start a more detailed discussion regarding my plans here and 
to see if anyone wants to add anything and to make sure I am not missing anything.

So the first aspect is to split and rename the concept which is currently termed 
org.hibernate.cache.Cache.  Now, there will be a base interface named 
o.h.c.Region, with 4 specializations: EntityRegion, CollectionRegion, 
QueryResultsRegion, TimestampsRegion (whose purpose are hopefully self-evident :)

Next, we need a SPI for building these various types of regions.  This is the 
role of the new o.h.c.SecondLevelCache interface.  It is somewhat akin to 
o.h.c.CacheProvider in terms of contract except that I break out different 
methods for building each "region type".  Currently there is one implementation 
OOTB: o.h.c.impl.SecondLevelBridge which acts as a bridge between this new API 
and the older CacheProvider stuff, which I decided to leave in place for the 
time being to make migration easier initially.  But this is where, for example, 
we'd plug in more intelligent region management like we have been discussing 
with the JBossCache team.

These changes also affect how o.h.c.CacheConcurrencyStrategy works.  First, I 
took this refactoring as an opportunity to rename CacheConcurrencyStrategy to 
AccessStrategy since that is more true to the role.  And actually this is split 
as well into EntityRegionAccessStrategy and CollectionRegionAccessStrategy, 
because I found this more natural and easier to follow from an implementation 
perspective (I did not really see a philosophical reason for this split).

Anyway, I attached the initial version of these contracts for an early peek.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cache-redesign.zip
Type: application/x-zip-compressed
Size: 12848 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20070328/f48e8d36/attachment.bin 


More information about the hibernate-dev mailing list