This article says a public static is best but I agree with other list
members that this is a bad idea UNLESS you are doing a simple implementation
when it is a good idea. If you are doing complex multi threaded stuff  you
would use a Property to make it public .

I have a question though is it better making the instance available to the
public or providing static methods that fully encapsulate the Singleton.
This will allow redesigns of the Singleton implementation without affecting
other classes.


Ben


-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter Meinl
Sent: Sunday, 9 June 2002 7:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Singleton pattern


This article discusses the singelton pattern and its Gof and .NET
implementation:
Exploring the Singleton Design Pattern
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnbda/html/singletondespatt.asp

--
Peter Meinl
ISTEC GmbH

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to