Hi folks,

I'd like to ask for suggestions for a problem solution regarding the
typesafe handling of cache keys in JCS.

Previously, JCS was not aware of key and value types. So it was possible
to mix cache elements having different key types within the same cache
instance. This "feature" was abused to implement the cache groups, so
that keys of e.g. type String were combined with keys of type GroupAttrName.

The current implementation implements this functionality by hacking
around the generics type definitions (in all cache implementations)
which is definitely not desirable. It also may cause ClassCastExceptions.

As I see it, it would be better to use some kind of decorator pattern
for the GroupCacheAccess functions that wraps around a regular
CacheAccess object. This would mean type-safety at the cost of major API
changes. Also it would have the advantage that the cache implementations
do not have to know about cache groups at all.

Are there better solutions? Other ideas how to resolve this?
Your thoughts are very much appreciated.

Bye, Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to