Interesting enough, System.Guid has a private constructor
which accepts
a boolean argument which, basically, says if the newly
created instance
of the struct should be zero-initialized or generated by the
system.
Efran Cobisi
http://www.cobisi.com
Dan Farino wrote:
> There's also a technical reason: System.Guid is a value
type and, as
> such, it can't have an explicit parameterless
constructor. All the
> fields are zero-initialized by the CLR unless a
constructor taking an
> argument is called.
>
> -Dan
>
> -----Original Message-----
> From: Discussion of development on the .NET platform
using any managed
> language [mailto OTNET-CL
R DISCUSS.DEVELOP.COM] On Behalf Of Efran
> Cobisi
> Sent: Thursday, December 14, 2006 2:50 AM
> To: DOTNET-CLR DISCUSS.DEVELOP.COM
> Subject: Re: [DOTNET-CLR] Guid Constructor
>
> I think this was a design driven decision. Since
creating a new Guid is
> a time consuming task and one usually would not expect
to perform a
> lenghty operation inside a constructor, calling a
method would be more
> appropriate in this case.
>
> HTH,
>
> Efran Cobisi
> http://www.cobisi.com
>
> Brady Kelly wrote:
>
>> Why do I have to use the Guid.NewGuid static method
to create a new,
>>
> random
>
>> Guid? A default, parameterless constructor seems
an ideal means to do
>>
> this.
>
>> ===================================
>> This list is hosted by DevelopMentor(r) http://www.develop.com
>>
>> View archives and manage your subscription(s) at
>>
> http://discuss.develop.com
>
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentorŪ http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|