static void Main() { FactoryBase factory = new ConcreteFactory(); ProductBase product = factory.FactoryMethod(1); product.ShowInfo(); product = factory.FactoryMethod(2); product.ShowInfo(); }
static void Test2() { IPerson person = ConcreteFactory.CreateProduct <ConretePerson>(); person.Angry(); person.Cry(); person.Eat(); person.Smile(); }