Sunday, April 3, 2011

Alternatives to EntLib caching application block?

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

From stackoverflow
  • 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.

    Orion Edwards : 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?
    Matt Briggs : well, a DI container is there to handle returning dependencies, how it returns them could be considered part of its purview.
    Orion Edwards : 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...
    Matt Briggs : Yeah, you've got me there. guess i didn't fully think through the problem. Edited my answer.

0 comments:

Post a Comment