Singletons in Session...?
- From: "laziers@xxxxxxxxx" <laziers@xxxxxxxxx>
- Date: Mon, 28 Jan 2008 01:35:19 -0800 (PST)
Hi,
It is a good practice to insert singletons in Session?
I have more than 5 singletons and Im not sure that inserting all in
session state is a good idee :|
singleton looks like this:
public class DAO
{
public static DAO Instance
{
get
{
if (System.Web.HttpContext.Current.Session["DAO"] ==
null)
{
System.Web.HttpContext.Current.Session["DAO"] =
new DAO();
}
return System.Web.HttpContext.Current.Session["DAO"]
as DAO;
}
}
private DAO() { }
}
bye.
.
- Follow-Ups:
- Re: Singletons in Session...?
- From: Michael Nemtsev [MVP]
- Re: Singletons in Session...?
- Prev by Date: Re: Call a javascript when i call an aspx page with a form html not running on server
- Next by Date: Windows Workflow Foundation on .NET 2.0?
- Previous by thread: Windows XP Pro, IIS and .NET 3.0/3.5
- Next by thread: Re: Singletons in Session...?
- Index(es):
Relevant Pages
|