public Product CreateProduct(ProductType productType) {
     Product product = default(Product);
     switch (productType) { 
         case ProductType.ProductA:
             product = new ConcreateProductA();
             break;
         case ProductType.ProductB:
             product = new ConcreateProductB();
             break;
     }
     return product;
 }
Exemple #2
0
        public Product CreateProduct(ProductType productType)
        {
            Product product = default(Product);

            switch (productType)
            {
            case ProductType.ProductA:
                product = new ConcreateProductA();
                break;

            case ProductType.ProductB:
                product = new ConcreateProductB();
                break;
            }
            return(product);
        }