Esempio n. 1
0
 static void Main()
 {
     FactoryBase factory = new ConcreteFactory();
     ProductBase product = factory.FactoryMethod(1);
     product.ShowInfo();
     product = factory.FactoryMethod(2);
     product.ShowInfo();
 }
Esempio n. 2
0
        static void Main()
        {
            FactoryBase factory = new ConcreteFactory();
            ProductBase product = factory.FactoryMethod(1);

            product.ShowInfo();
            product = factory.FactoryMethod(2);
            product.ShowInfo();
        }
Esempio n. 3
0
        static void Test2()
        {
            IPerson person = ConcreteFactory.CreateProduct <ConretePerson>();

            person.Angry();

            person.Cry();

            person.Eat();

            person.Smile();
        }