Google's Go & Exceptions
Nick Sabalausky
a at a.a
Sun Jan 31 02:01:00 PST 2010
"John D" <jdean at googling.com> wrote in message
news:hk3f9n$1t0f$2 at digitalmars.com...
>
> "Nick Sabalausky" <a at a.a> wrote in message
> news:hk3bij$1k4q$1 at digitalmars.com...
>> "John D" <jdean at googling.com> wrote in message
>> news:hk0mph$2dt6$1 at digitalmars.com...
>>>
>>> "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message
>>> news:hjo75f$2g30$1 at digitalmars.com...
>>>> Nick Sabalausky wrote:
>>>>>
>>>>> Still within the context of this D BigInt example, what benefit does
>>>>> using a factory method provide over a throwing constructor?
>>>>>
>>>>> I've always seen factories as falling into one of two categories: 1. A
>>>>> hack to get around a limitation in a language's constructor feature.
>>>>> or 2. Part of a helper API (I guess the kids are calling those
>>>>> "facades" these days...) for pre-configuring a new instance in a
>>>>> commonly-useful, but non-default way.
>>>>
>>>> Factories are mostly (imho) important in the fourth scenario: when you
>>>> want to create an object from data.
>>>>
>>>
>>> I vote for #3: Factories are most important for getting interfaces out
>>> of dynamic libraries.
>>
>> Can you elaborate on this?
>>
>
> I can. But I shouldn't have to. So shut up.
I see we have another superdan on our hands. If it even is another...This
screwball did show up around the time superdan disappeared.
More information about the Digitalmars-d
mailing list