Beispiel #1
0
        static void Main(string[] args)
        {
            IFactory factory = new UndergraduteFactory();
            LeiFeng  student = factory.createLeiFeng();

            student.BuyRice();
            student.Sweep();
            student.Wash();

            Console.Read();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            IFactory factory;
            LeiFeng  student;

            factory = new UndergraduteFactory();
            student = factory.CreateLeiFeng();
            student.BuyRice();
            student.Sweep();
            student.Wash();

            factory = new VolunteerFactory();
            student = factory.CreateLeiFeng();
            student.BuyRice();
            student.Sweep();
            student.Wash();
            Console.ReadLine();
        }