Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nMaking tea...");
            Tea tea = new Tea();
            tea.PrepareRecipe();

            Console.WriteLine("\nMaking coffee...");
            Coffee coffee = new Coffee();
            coffee.PrepareRecipe();

            // Hooked on Template (page 292)

            Console.WriteLine("\nMaking tea...");
            TeaWithHook teaHook = new TeaWithHook();
            teaHook.PrepareRecipe();

            Console.WriteLine("\nMaking coffee...");
            CoffeeWithHook coffeeHook = new CoffeeWithHook();
            coffeeHook.PrepareRecipe();

            // Wait for user
            Console.ReadKey();
        }