views:

353

answers:

1

I'm developing a windows client app and would like to cache some data. It's a pretty simple scenario, basically just keeping some data in memory so the app can avoid crashing if the network connection drops out.

I could roll my own cache solution, or use the EntLib caching block, but am looking for a few more alternatives before committing to something.
The problem is, all the searches I've done either show:

  • The entlib block (which I already know about)
  • The ASP.NET cache (which I can't use)
  • Velocity (which is distributed, and requires a windows service to connect to)
  • NCache (also distributed, similar to velocity)

Surely there are some other in-memory caching libraries out there?

Thanks

+1  A: 

Any caching I have done in winforms I have done with static variables, but if I were doing something non trivial, I would probably be using a DI framework and just use its caching. http://blogs.conchango.com/owainwragg/archive/2008/10/31/caching-with-castle-windsor.aspx

Not a complete solution though. It makes sense for caching of objects returned from the DI kernel, but not nessicarily arbitrary values.

Matt Briggs
What has a DI container got to do with caching? I can see that windsor obviously provides this functionality in a rich way, but why on earth would you do that?
Orion Edwards
well, a DI container is there to handle returning dependencies, how it returns them could be considered part of its purview.
Matt Briggs
good point, and this makes sense if you're returning objects out of your DI container... It seems like the wrong thing if I just want to cache say a large chunk of XML or similar though...
Orion Edwards
Yeah, you've got me there. guess i didn't fully think through the problem. Edited my answer.
Matt Briggs