Most of the caching frameworks have the not up-to-date issue, they just limiting to cache a result for a given period of time. So if you have to invalidate the cache, you must do it manually.
That's the not ordinary part of CacheAware, it does that magically. The purpose of this document is to explaining how the magic is done.
CacheAware works intercepting calls each @CacheAwareFactory annotated method and collects all entities used inside its execution. Then assumes that all those collected entities are involved (or part) of that method result.
So if any of them changes, there is no warranty the cached result is up-to-date and therefore is invalidated.
A couple of questions arise from the above statement:
That will be answered soon, but lets introduce a few concepts first.
CacheAware distinguishes between tree kind on objects:
So... what's the difference between immutables and ignored objects?
Basically immutable means that they are not entities, but they current value matters. In the localized example above, a en_US value for Locale should produce a different result than es_ES, and both result should be cached.
ignored objects means that regardless the actual value given, the result should be the same. In the localized example above, if Locale parameter is marked as ignored, then only one result will be cached and returned the same on every call, regardless the actual value for Locale.
One last conclusion: Yes, entities and immutables, can be at the same time ignored (rarely you will need to do that). entities and immutables are definitions for a class-level, ignored are for a particular method's parameter.
Not egough? Check the [Behind The Magic] section