"Nick Sabalausky" <[email protected]> wrote in message news:[email protected]... > "John D" <[email protected]> wrote in message > news:[email protected]... >> >> "Andrei Alexandrescu" <[email protected]> wrote in message >> news:[email protected]... >>> 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.
