Esempio n. 1
0
        static void Main(string[] args)
        {
            // Abstract Factory 1
            AbstractFactory factory1 = new ConcreteFactory1();
            Client          client1  = new Client(factory1);

            client1.run();

            // Abstract Factory 2
            AbstractFactory factory2 = new ConcreteFactory2();
            Client          client2  = new Client(factory2);

            client1.run();

            Console.ReadLine();
        }
Esempio n. 2
0
        /// <summary>
        /// The Calling Application
        /// </summary>
        static void Main(string[] args)
        {
            // Abstract factory #1
            AbstractFactory factory1 = new ConcreteFactory1();
            Client          client1  = new Client(factory1);

            client1.Run();

            // Abstract factory #2
            AbstractFactory factory2 = new ConcreteFactory2();
            Client          client2  = new Client(factory2);

            client2.Run();

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