Singletons in Session...?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.
.



Relevant Pages

  • Re: Singletons in Session...?
    ... l> It is a good practice to insert singletons in Session? ... l> session state is a good idee:| ... l> public class DAO ... l> public static DAO Instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Java DAO pattern: singleton and threadsafe?
    ... There's one abstract DAO ... That the DAOs are singletons and that there is one abstract superclass are orthogonal. ... I think a different connection should be gotten from the datasource ...
    (comp.lang.java.programmer)