I am developing the Rest API using the Service Stack framework. All layers are separated, so we can do DAL mocks to test the logic level.
I am setting up a cache with control inversion:
container.Register<ICacheClient>(new MemoryCacheClient());
Where MemoryCacheClient is a simple class that implements ICacheClient several ways.
And here is the question: what is the best layer for including a call in the cache through this inversion of control?
It may be in BLL, but would it not be a problem for unit tests?
Could it be in DAL, knowing that I have to lose the IOC? And in this case, I will depend on the web server cache, which may be wrong.
It can be in the web interface, knowing that I can have some logic and even lose some functions?
Could this be between the web interface and the BLL, creating a new layer?
I searched and read some articles a lot, but no luck:
Thanks x
Junior Suzuki
source share