001package headfirst.factory.pizzas; 002 003public class PizzaStore { 004 SimplePizzaFactory factory; 005 006 public PizzaStore(SimplePizzaFactory factory) { 007 this.factory = factory; 008 } 009 010 public Pizza orderPizza(String type) { 011 Pizza pizza; 012 013 pizza = factory.createPizza(type); 014 015 pizza.prepare(); 016 pizza.bake(); 017 pizza.cut(); 018 pizza.box(); 019 020 return pizza; 021 } 022 023}