Loading...
DotNetKicks.com
.NET links, community driven
login
register
submit a story
upcoming stories
about
blog
Why not
join our community?
, there are
16 users online
home
users
Davbis93
comments
DotNetKick.com is an
open-source project
. Please
report any bugs
and let us know
your great suggestions
.
Currently running svn revision
620
(rss)
Kick Spy!
,
Kick Zeitgeist
and
Kick Widgets
Davbis93
Profile
Kicked
Submitted
Comments
Tags
Friends
Kicked By Friends
Submitted By Friends
Comments:
Implementing Generic Caching
Hi,
Regarding your suggestion of using a static property - I completely agree, and have updated the code sample accordingly.
Also, regarding the HttpContext dependency, I originally had a singleton implementation, which I removed from this post for the sake of brevity, however you've inspired me to put this back in, as some may find it useful.
simonech, Given the example you suggested, if using this, you'd be forced to cache the "whole newspaper" and use something like: SafeCache<Newspaper>.Object.Categories(2).
However, I think it might be possible to have a different version of this, which is parameterized generically, by having:
public SafeCache<Type, Parameter>
{
public Type GetObject(Parameter param)
{
//Get and cache including param.ToString() somehow in the cache-key
}
}
I'm sure there's probably a more flexible way of doing this.
Thanks for your ideas,
Dave
posted by
Davbis93
5 months, 16 days ago
How to Expose Your Collections Safely
I exposed my collection in an unsafe manner once.
Ended up spending a night in the slammer :(
posted by
Davbis93
6 months, 5 days ago
« Previous
1
Next »
Sponsored Link:
www.carlist.ie
Search:
Ads via The Lounge
DotNetKicks is an open source project from
Incremental Systems