BT

Extensible Caching Added to .NET 4.0

by Jonathan Allen on May 12, 2010 |

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.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

A bit late to the game by peter lin

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

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/

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT