I recently decided to implement caching using the interceptor functionality from castle. It works fine.
My question: If I wanted to avoid the interceptor for a particular call, what strategy would you suggest using?
I've already determined I could have two implementations of a given service one that supports the caching aspect and one that doesn't. I could then call the appropriate one from wherever. I don't like that for many reasons.
I'd be ok with invalidating the cache at the point I knew it would be invalid, but I couldn't come up with a good solution following this line of thinking that still kept caching concerns out of my code.
I usually use decorators for caching concerns.
About removing / invalidating cache item I came out with a solution event based:
real service exposes events for those behaviors changing the system(for ex adding or update an item), decorator service(caching strategy) registers itseself to those events to manage the cache.