Esempio n. 1
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;
 }
Esempio n. 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);
        }