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 Subscribe to this feed
Davbis93
Profile Kicked Submitted Comments Tags Friends Kicked By Friends Submitted By Friends


Comments:

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

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
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge