In this recipe we will implement an abstraction on top of Windows Server AppFabric Cache. The idea is to support:
Multiple implementations of a Cache provider
Ability to switch providers via configuration
As Windows Server AppFabric Cache is an external subsystem, it makes sense to have an abstraction around it and have the capability to plug in a suitable implementation at runtime.
Note
Consider a scenario for an ISV (Independent Software Vendor) where their application is built using Windows Server AppFabric Cache. One of their customers does not have Windows Server 2008 so they cannot install Windows Server AppFabric Cache. If ISV was able to implement a provider model such that they could switch Cache implementations via a configuration switch (for example, replacing Windows Server AppFabric Cache with ASP.NET's HttpCache) they would still be able to sell their product to this customer.
Of course, there is a feature cost associated with this type of generalization...