Roni Schuetz


Shared Cache Samples



Shared Cache Samples


The Shared Cache Sample Zip contains various samples how you easly can integrate shared cache into your solution. In general I suggest to write a wrapper as its described here: shared cache wrapper. This wrapper will help you to centralize all your cache calls and it makes you independent in case you need to switch or shift to a different version of shared cache or even a different product. An advanced wrapper which combines between local and distributed caching can be downloaded here: Shared Cache Wrapper. Personally I do NOT suggest to make this since I sure best approach is to distribute cached data. But as always - there are 1000 way's to reach the target!
More facts or data can be always received at my technical blog which is available here: Roni Schuetz.

01_RegularExpression - created: Monday, 16 Feb. 2009


Regular Expressions are often used to create relationships between objects within cache but its far away to replace object dependency.
Upon usage of Regular Expressions we can imagne we have a kind of grouping functionlity. Yes its fast since you mostly reduce network traffic dramatically! The return value is a dictonary:
IDictionary a2 = CACHE.SharedCache.RegexGet("a2_*.");
All you send over the network is your regular expression pattern: "a2_*.".
If you're using it you receive a dictonary of type IDictionary.
The disadvantage of the current implementeation is - you need to cast your objects by yourself but its done easly e.g.:
Common.Serializable.Person p = SharedCache.WinServiceCommon.Formatters.Serialization.BinaryDeSerialize(item.Value);

Download Samples

here are the sample(s): Shared Cache Sample Zip