ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Form Your Own Design Pattern Study Group
Subject:   HFDP's Abstract Factory example discussion
Date:   2005-05-03 02:50:32
From:   MatthiasWeidmann

We've a design patterns study group here using
the HFDP book, which we enjoy a lot.


One thing we noticed in our last session is that
the abstract factory pattern somehow didn't flow
for us. Investigating, discussing, thinking,
we believe what blew us is two things:


1st) Wouldn't it make more sense if the PizzaIngredientFactory is still a PizzaFactory, that is, if the abstract factory is enhanced with the ability to create pizzas as well. This would be in line with the GoF's abstract factory MazeFactory example as well (GoF, p.92), where the creation of the Maze itself is part of the abstract factory.


2nd) Further, the other thing which troubled us is the NYPizzaStore and ChicagoPizzaStore. Shouldn't the store specifics be dealt with only by having selected the appropriate factory ?


We've changed the example's source code to be aligned with our thinking, and to us it looks easier to understand, especially when comparing it to the preceding Factory Method example.


Thoughts/opinions very appreciated,
Matthias


1 to 2 of 2
  1. HFDP Study Group on-line
    2005-08-29 23:52:53  Jackar [View]

  2. HFDP's Abstract Factory example discussion
    2005-05-11 20:09:56  gtwdaizi [View]

    • HFDP's Abstract Factory example discussion
      2005-05-18 02:08:41  MatthiasWeidmann [View]

1 to 2 of 2