Re: Create Null Object
- From: "Scott" <sdcoonce@xxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 20:33:53 +0200
Ah, yes, I forgot about that, Jon.
Scott
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1da5a8b42c16299298c7fe@xxxxxxxxxxxxxxxxxxxxxxx
> Scott <sdcoonce@xxxxxxxxxxxxxxxxx> wrote:
>> As a reminder, as an addition to that, so that users of the class don't
>> just
>> call the constructor and circumvent your CreateRole() static method, make
>> the constructo private, as in:
>>
>> private Role() {}
>
> Note that you don't need to supply an extra private parameterless
> constructor if you have other constructors (which would probably also
> be private). The compiler only supplies a public parameterless
> constructor if no constructors are specified in the code.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
.
- References:
- Re: Create Null Object
- From: Scott
- Re: Create Null Object
- From: Jon Skeet [C# MVP]
- Re: Create Null Object
- Prev by Date: Re: Vb.net to C#
- Next by Date: SqlDependency in WinFormsApp
- Previous by thread: Re: Create Null Object
- Next by thread: Re: Create Null Object
- Index(es):
Relevant Pages
|
Loading