Re: Difference between Factory and Abstract Factory
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Mon, 26 Mar 2007 15:40:18 GMT
Responding to EvilOldGit...
I've read the gang of four, and various things I've googled, but I'm
just too stupid to really get the difference between a factory and an
abstract factory.
The difference lies in how dynamic the substitution needs to be. In both cases the Product and the Factories to produce them are generalizations. The difference is that in Factory Method the subclasses in each generalization map 1:1 to each other while in Abstract Factory the Factory subclasses map 1:* to Product subclasses.
Thus in Factory Method a concrete factory object can instantiate exactly one flavor of one Product. But in Abstract Factory a single concrete factory object can instantiate a different flavor of Product from each of multiple Product generalizations. IOW, one uses Factory Method when there is only one family of products and one uses Abstract Factory when there are construction similarities across multiple families of products.
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.
- References:
- Difference between Factory and Abstract Factory
- From: EvilOldGit
- Difference between Factory and Abstract Factory
- Prev by Date: Re: OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- Next by Date: Re: Long Life Objects
- Previous by thread: Re: Difference between Factory and Abstract Factory
- Next by thread: Re: Difference between Factory and Abstract Factory
- Index(es):
Relevant Pages
|