예제 #1
0
파일: Program.cs 프로젝트: pelehok/patterns
        static void Main(string[] args)
        {
            AbstractCustomer customer1 = CustomerFactory.GetCustomer("Rob");
            AbstractCustomer customer2 = CustomerFactory.GetCustomer("Bob");
            AbstractCustomer customer3 = CustomerFactory.GetCustomer("Julie");
            AbstractCustomer customer4 = CustomerFactory.GetCustomer("Laura");

            Console.WriteLine("Customers");
            Console.WriteLine(customer1.GetName());
            Console.WriteLine(customer2.GetName());
            Console.WriteLine(customer3.GetName());
            Console.WriteLine(customer4.GetName());
            Console.ReadKey();
        }
예제 #2
0
        public static void Demo()
        {
            AbstractCustomer c1 = CustomerFactory.GetCustomer("A");
            AbstractCustomer c2 = CustomerFactory.GetCustomer("D");
            AbstractCustomer c3 = CustomerFactory.GetCustomer("B");
            AbstractCustomer c4 = CustomerFactory.GetCustomer("e");

            Console.WriteLine(c1.GetName());
            Console.WriteLine(c2.GetName());
            Console.WriteLine(c3.GetName());
            Console.WriteLine(c4.GetName());


            Console.Read();
        }