in reply to Constructor/Factory Orthodoxy
I don't think there's anything inheriently wrong with what you describe, back in the day I had lots of "constructors" that were really "factories" (except that I wasn't doing dynamic Module loading ... they were all spelled out at the top).
I don't find myself writting code like that much anymore ... A big part of that has to do with the general code conventions of where I work now ... but even when I write code for personal projects, I don't think I would use the "Constructor is a Factory" approach -- mainly for clarity.
Ask yourself what (if anything) you gain by calling your factory method "new", and if it's worth the possible confusion of other people reading your code in the future.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Constructor/Factory Orthodoxy
by mojotoad (Monsignor) on Feb 26, 2003 at 00:11 UTC |