Microsoft’s Patterns and Practices team has always had a less than stellar reputation. Seen as something ‘other’, they rarely get the attention and respect that the rest of Microsoft’s .NET development teams. Their Enterprise Library consists of customizable components, all open source, that cover the scenarios that most development shops traditionally build on their own or find amongst open source projects ported from Java.
One such component has been promoted into full .NET Framework. Now known as System.Runtime.Caching, this is not only a caching library but also a framework for developing your own libraries. The ObjectCache defines the common operations that all caches should implement. It is paired with an in-memory implementation called MemoryCache. In theory wrappers for other caching products can be created, allowing developers to easily swap out for other implementations.
Cache invalidation can be triggered by events, which are represented by ChangeMonitor objects. Out of the box you only file-based and a SQL Server-based monitors, but others can be easily built. Quite unusual for API documentation in any langauge, the ChangeMonitor contains detailed information on how to correctly implement subclasses.
Community comments
A bit late to the game
by peter lin,
NCache now provides an implementation for .NET 4.0 Caching
by Iqbal Khan,
A bit late to the game
by peter lin,
Your message is awaiting moderation. Thank you for participating in the discussion.
Even though Microsoft is late to the game, it's nice to see .NET get standardized caching. It's going to take a while for it to catch up to existing mature products.
NCache now provides an implementation for .NET 4.0 Caching
by Iqbal Khan,
Your message is awaiting moderation. Thank you for participating in the discussion.
As you know, NCache is a really popular distributed cache for .NET. Now, NCache has implemented the .NET Caching provider so you can use NCache with System.Runtime.Caching.
Check it out at www.alachisoft.com/ncache/