I'm developing a Rest API using Service Stack's framework. All layers are separated so we can make DAL mocks for business logic layer unit testing.
I'm configuring the cache with inversion of control:
container.Register<ICacheClient>(new MemoryCacheClient());
Where MemoryCacheClient
is a simple class that implements ICacheClient
with a few methods.
And here is the question: What is the best layer in which to include the call to the cache through this inversion of control?
It could be in the BLL, but won't it bring problems to unit tests?
It could be in DAL, knowing that I would have to lose IOC? And, in this case, I will depend of webserver's cache, that could be wrong.
It could be in Web interface, knowing that I can have some logic here and even lose some features?
It could be between web interface and BLL, creating a new layer?
I've searched a lot and read some articles, but with no lucky:
Help with debate on Separation of concerns (Data Access vs Business Logic)
http://www.velocityreviews.com/forums/t639532-3-tier-design-and-cache-for-asp-net-3-5-a.html
- http://forums.asp.net/t/1795015.aspx/1
Thank's