B
Bob
It seems to me that using static classes for caching as versus the
Application object has certain advantages. First, the cached values are
strongly typed, secondly, it's not ASP.NET specific so the same code can be
used for other .NET apps. I can't think of anything bad about it. I only
plan to use it for a small number of non-volatile values (but needs to be
read from DB or other sources once) so it's like I'd put everything in a
static class.
Here's a piece of sample code:
Class App {
private static XslTransform _menuXsl;
public XslTransform {
get { return _menuXsl; }
set { _menuXsl = value; }
}
}
Application object has certain advantages. First, the cached values are
strongly typed, secondly, it's not ASP.NET specific so the same code can be
used for other .NET apps. I can't think of anything bad about it. I only
plan to use it for a small number of non-volatile values (but needs to be
read from DB or other sources once) so it's like I'd put everything in a
static class.
Here's a piece of sample code:
Class App {
private static XslTransform _menuXsl;
public XslTransform {
get { return _menuXsl; }
set { _menuXsl = value; }
}
}