How should I create application wide utility/manager classes that read settings from the database? Should I use static classes e.g.
public static class ThemeHelper
{
private static string themeDirectory { get; private set; }
static ThemeHelper()
{
// read from the database
themeDirectory = "blue-theme";
}
public static string ResolveViewPath(string viewName)
{
string path = string.Format("~/themes/{0}/{1}.aspx", themeDirectory, viewName);
// check if file exists...
// if not, use default
return path;
}
}
or a static instance of a normal class, which is stored in the HttpApplicationState for example? Or should I use dependency injection library (like Ninject)?