Exemplo n.º 1
0
 public override void prepare()
 {
     Console.WriteLine("Preparing" + name);
     dough = ingredientFactory.createDough();
     sauce = ingredientFactory.createSauce();
     clam  = ingredientFactory.createClam();
 }
Exemplo n.º 2
0
 public override void Prepare()
 {
     Console.WriteLine("准备:" + name);
     dough  = _pizzaIngredientFactory.createDough();
     sauce  = _pizzaIngredientFactory.createSauce();
     cheese = _pizzaIngredientFactory.createCheese();
     clam   = _pizzaIngredientFactory.createClam();//纽约工厂就会使用新鲜的蛤蜊,芝加哥工厂就会用冷冻的蛤蜊。
 }