Or maybe the class should be abstract (and sealed aka not inheritable aka
final)

// Ryan

-----Original Message-----
From: David Ferguson [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 24 mei 2002 16:48
To: [EMAIL PROTECTED]
Subject: [DOTNET] Should constructors of all static classes be private?


It seems like a class with only static functions should have a private
constructor, since you shouldn't need to create an instance of the
class.

For example:

    class AllStatic
    {
        private AllStatic() {} // No sense instantiating one of these

        public static Method1() {...}
    }

Or maybe you should allow the user to create an instance.  It really
shouldn't hurt anything.

What do you think?

Is there a special name for a class with all static members?

Thanks...David

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


-------------------------------------
The information included in this message is personal and/or confidential and
intended exclusively for the addressees as stated. This message and/or the
accompanying documents may contain confidential information and should be
handled accordingly. If you are not the intended reader of this message, we
urgently request that you notify Centric immediately and that you delete
this e-mail and any copies of it from your system and destroy any printouts
immediately.
It is forbidden to distribute, reproduce, use or disclose the information in
this e-mail to third parties without obtaining prior permission from
Centric. We expressly point out that there are risks associated with the use
of e-mail. Centric and the companies within the group shall not accept any
liability whatsoever for damage resulting from the use of e-mail. Legally
binding obligations can only arise for Centric by means of a written
instrument, signed by an authorized representative of Centric.
-------------------------------------

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

Reply via email to