Exemplo n.º 1
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            if (type.Equals("cheese"))
            {
                pizza = new NYPizzaCheese();
            }

            return(pizza);
        }
Exemplo n.º 2
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IPizzaIngredientsFactory pizzaIngredientsFactory = new NYPizzaIngredientsFactory();

            if (type.Equals("cheese"))
            {
                pizza = new NYPizzaCheese(pizzaIngredientsFactory);
            }

            return(pizza);
        }