Re: Singletons in asp



yes .net sorry.

I am more wanting to know how it will handle a singleton implementation not
how to implement one, tho i cant see an singleton implementation on that
blog? Is it very different to a standard one on .net?



"sloan" <sloan@xxxxxxxxx> wrote in message
news:%23GxTXJjaHHA.1216@xxxxxxxxxxxxxxxxxxxxxxx
First, I'll assume you're speaking of asp.net and not just asp.

They are different things.

Here is an example of a asp.net singleton:

10/24/2005
Web Session Wrapper for storing and retrieving objects
http://sholliday.spaces.live.com/blog/


PS
You should mark
public class WebSessionDataStore

as [Serializable]

and make any objects you put in there serializable if you go to sql server
session state management.



"PokerMan" <nospam@xxxxxxxxxxxxxx> wrote in message
news:ukskBEjaHHA.4788@xxxxxxxxxxxxxxxxxxxxxxx
Hey guys

Just a quick question. If i had a static var, then all users coming onto
my
site will be sharing the same var. So if i have a class that is a
singleton
would the same happen there?

Basically i have a class that will only ever have one instance so,
singleton
makes sense. But due to asp and lots of connecting users it had me
wondering
if the singleton would work as one isntance per user or one instance for
all
users (not what i want)

Thanks






.



Relevant Pages

  • Re: Singletons in asp
    ... So in answer to my original question a singleton will work as i expect? ... Web Session Wrapper for storing and retrieving objects ... public class WebSessionDataStore ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Singletons in asp
    ... Here is an example of a asp.net singleton: ... Web Session Wrapper for storing and retrieving objects ... public class WebSessionDataStore ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Singleton Question
    ... > Can somebody point me to a spec for singleton implementation? ... Singleton is a pattern, not a specification. ... an instance of MySingletonClass until the first time getInstance is ...
    (comp.lang.java.programmer)
  • Re: Singletons in asp
    ... So in answer to my original question a singleton will work as i expect? ... Web Session Wrapper for storing and retrieving objects ... public class WebSessionDataStore ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Singleton Implementation Issue
    ... Why does [wanting to create a Singleton with a particular state upon ... My current motivation is as follows: At application startup I'm wanting to ... Singleton effectively makes the constructor unavailable to clients. ... I want to have a Singleton implementation that requires ...
    (microsoft.public.dotnet.languages.csharp)