Re: Singletons in asp
- From: bruce barker <nospam@xxxxxxxxxx>
- Date: Mon, 19 Mar 2007 08:25:30 -0700
it can be coded either way, depends on how you code it.
-- bruce (sqlwork.com)
PokerMan wrote:
Ah found ur singletom implementation on the blog, my apologies. And its similar to mine, not sure why you use a method and dont set the instance as a property get{} but its the same in essence..
So in answer to my original question a singleton will work as i expect? Single instance per user, not one instance effected by all users?
"sloan" <sloan@xxxxxxxxx> wrote in message news:%23GxTXJjaHHA.1216@xxxxxxxxxxxxxxxxxxxxxxxFirst, 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 guysmy
Just a quick question. If i had a static var, then all users coming ontosite will be sharing the same var. So if i have a class that is asingletonwould the same happen there?singleton
Basically i have a class that will only ever have one instance so,makes sense. But due to asp and lots of connecting users it had mewonderingif the singleton would work as one isntance per user or one instance forallusers (not what i want)
Thanks
- References:
- Singletons in asp
- From: PokerMan
- Re: Singletons in asp
- From: sloan
- Re: Singletons in asp
- From: PokerMan
- Singletons in asp
- Prev by Date: Re: try to create my own server control
- Next by Date: Re: Load different stylesheets at runtime
- Previous by thread: Re: Singletons in asp
- Next by thread: Re: Singletons in asp
- Index(es):