Exemple #1
0
        public static void Main()
        {
            /*
             * Below commented code is for Simple Factory
             *
             *
             * SimplePizzaFactory simplePizzaFactory = new SimplePizzaFactory();
             *
             * Console.WriteLine("1st Pizza --> \n");
             *
             * PizzaStore pizzaStore = new PizzaStore(simplePizzaFactory);
             * pizzaStore.OrderPizza("cheese");
             *
             * Console.WriteLine("\n2nd Pizza --> \n");
             * pizzaStore.OrderPizza("farmhouse");
             */

            /*
             * Below commented code is for FactoryMethod
             *
             */

            Console.WriteLine("1st Pizza --> \n");

            PizzaStore mumbaiPizzaStore = new MumbaiPizzaStore();

            mumbaiPizzaStore.OrderPizza("farmhouse");

            Console.WriteLine("\n2nd Pizza --> \n");

            PizzaStore delhiPizzaStore = new DelhiPizzaStore();

            delhiPizzaStore.OrderPizza("peppypaneer");
        }
        static void Main(string[] args)
        {
            // Change in requirement franchising pizza outlet000000000
            PizzaStore mumbaiStore = new MumbaiPizzaStore();
            PizzaStore delhiStore  = new DelhiPizzaStore();

            Pizza pizza = mumbaiStore.orderPizza("Cheese");

            pizza = delhiStore.orderPizza("Cheese");
        }