in reply to Re: Constructor/Factory Orthodoxy
in thread Constructor/Factory Orthodoxy

I'm not here to defend the name "new()" as a factory (I'm not really here to defend anything -- I'm here to learn).

Symantically, of course, what you say makes sense -- so let's say I call the factory "Bubba::makeBubba". What then of my example? What do you call it, etc? (we can assume that there's also a new() which boostraps from makeBubba() )

My main question, which I fear was obscured by my reference to a dual-function constructor, concerned this notion of returning subclasses based on parameters vs instantiating the subclasses directly (programmer's choice). In so doing, I was happy to utilize an inheritable constructor as well. (regardless of where the factory method might reside)

Thanks,
Matt

Replies are listed 'Best First'.
Re: Re: Re: Constructor/Factory Orthodoxy
by dws (Chancellor) on Feb 26, 2003 at 00:25 UTC
    Let's say I call the factory "Bubba::makeBubba". What then of my example? What do you call it, etc?

    I'd pick a name that expresses the intent of the operation. "makeBubba" might be fine. "makeBubbaMeal" might be better. It depends on what your example would look like fully fleshed out.