I know that I was two years late for the game, but I wanted to add something:
If you have an interface specific to your DAL, you can write a caching mechanism that follows that interface and manages the "cache against problems with the data source", without using the DAL code associated with the technology or source code to worry about it and without BLL to worry about it. Example:
internal interface IThingsGateway { public Thing GetThing(int thingId); public void UpdateThing(ThingUpdateInfo info); } internal class MsSqlThingsGateway : IThingsGateway {
And I would use the same approach if I needed to check several data sources for something: write an implementation of IThingsGateway , which handles the logic of manipulating various data sources, delegating the relevant information ... then we finish that in CachingThingsGateway . Client code will eventually receive an IThingsGateway link from some factory or container where the wrapping and instantiation will take place.
And all this really does not require much effort. If you use caching, you will have to write this code anyway, and the overhead created by putting it in another class with the same interface is minimal in the worst case.
tuespetre
source share