001package headfirst.factory.pizzaaf; 002 003public class ClamPizza extends Pizza { 004 PizzaIngredientFactory ingredientFactory; 005 006 public ClamPizza(PizzaIngredientFactory ingredientFactory) { 007 this.ingredientFactory = ingredientFactory; 008 } 009 010 void prepare() { 011 System.out.println("Preparing " + name); 012 dough = ingredientFactory.createDough(); 013 sauce = ingredientFactory.createSauce(); 014 cheese = ingredientFactory.createCheese(); 015 clam = ingredientFactory.createClam(); 016 } 017}