jsr107/jsr107spec — Issue #38: Explicit Seperation of Declarative Caching and Annotations
Author: edalquist
Created: 2011-11-15 21:21:17+00:00
State: open

After conversations with Yannis and others I think we need more explicit separation of the caching API and the caching annotations. To try and clarify this separation:

The JSR-107 Annotations implementation in no way relies on any specific implementation of the JSR-107 Caching APIs. A spec compliant annotation implementation will work against *any* implementation of the caching APIs. The CacheManager has no role in making the caching annotations function other than providing an API to access named caches.

It could be the case that the declarative caching APIs and caching annotations reside in separate JSRs with the annotations JSR simply referencing the caching JSR. Realistically I'm not sure it would be a positive thing to actually have this level of separation. What I would like to see is the following set of changes made:

* Determine a way to update and structure the spec document to clearly communicate that while the annotations depend on the caching APIs they are two separate features and likely will have independent implementations.
* Move the ANNOTATIONS field from the OptionalFeature enum
* Add a CachingAnnotations class which would have a similar role to the existing Caching object
* Add a CachingAnnotations.isEnabled() static API which would allow a runtime check to determine if annotation based caching is enabled.
* Split the TCK into two modules, one for declarative caching tests and the other for caching annotations tests.