/// <summary>
        /// Entry point into console application.
        /// </summary>
        public static void Main()
        {
            // Create and run the African animal world
            ContinentFactory africa = new AfricaFactory();
            AnimalWorld      world  = new AnimalWorld(africa);

            world.RunFoodChain();

            // Create and run the American animal world
            ContinentFactory america = new AmericaFactory();

            world = new AnimalWorld(america);
            world.RunFoodChain();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var africa = new AfricaFactory();
            var world  = new AnimalWorld(africa);

            world.RunFoodChain();

            var america = new AmericaFactory();

            world = new AnimalWorld(america);
            world.RunFoodChain();

            Console.ReadKey();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ContinentFactory africa = new AfricaFactory();
            AnimalWorld      world  = new AnimalWorld(africa);

            world.RunFoodChain();

            ContinentFactory america = new AfricaFactory();

            world = new AnimalWorld(america);
            world.RunFoodChain();

            Console.ReadKey();
        }
Exemplo n.º 4
0
        /// <summary>
        /// MainApp startup class for Real-World
        /// Abstract Factory Design Pattern.
        /// </summary>
        static void Main(string[] args)
        {
            // Create and run the African animal world
            ContinentFactory africa = new AfricaFactory();
            AnimalWorld      world  = new AnimalWorld(africa);

            world.RunFoodChain();

            // Create and run the American animal world
            ContinentFactory america = new AmericaFactory();

            world = new AnimalWorld(america);
            world.RunFoodChain();

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