static void Main(string[] args)
        {
            PizzaFactory factory    = new RandomTwoPizzaFactory();
            PizzaStore   pizzaStore = new PizzaStore(factory);
            Pizza        p          = pizzaStore.OrderPizza();

            Console.WriteLine();
            Console.WriteLine(p);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SimplePizzaFactory pizzaFactory = new SimplePizzaFactory();
            PizzaStore         pizzaStore   = new PizzaStore(pizzaFactory);

            Pizza pizza = pizzaStore.OrderPizza("cheese");

            Console.WriteLine("A customer ordered a {0}", pizza.GetName());
            Console.WriteLine("");

            Console.ReadLine();
        }