Static methods provide no more encapsulation than instance methods. Static
methods are less flexible because they cannot be virtual. I don't see any
advantage.

The property which retrieves the Singleton instance must be static.

If the Singleton has no data at all, then it makes sense to just use a
bunch of static methods. But then it is not a Singleton anymore. It is
just a collection of functions, and you no longer need an instance.

On Mon, 10 Jun 2002 12:02:00 +0800, Ben Kloosterman
<[EMAIL PROTECTED]> wrote:
>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.

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