Question

I read some articles about SqlCacheDependency. I think it is a really cool way for updating caches, but i'm not sure how i can handle this technologie if my application is a n-tier architekture.

Is this just useful if my program is a small webapplication, or is there also a way for use in big n-tier architektures?

Was it helpful?

Solution

You can create your own ICacheDependency interface and use a factory class to give you the appropriate object. This way neither your DAL or BL need to reference System.Web namespace. You can put this factory class in a common tier and reference it in the UI layer.

MS Petshop 4 has used something like this, you may want to follow that.

OTHER TIPS

In this case, you would need to have your DAL return you an object that derives from the CacheDependency abstract class, that would do the same thing as SqlCacheDependency, but optimized for your DAL.

This is, of course, a failure of separation of concerns, but if you need the dependency, it's the best way to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top