Exemple #1
0
        public static IProduct CreateProduct(string productName)
        {
            IProduct product = null;
            switch (productName)
            {
                case "ConcreateAProudct":
                    product = new ConcreteAProduct();
                    break;
                default:
                    product = new ConcreteProduct();
                    break;
            }

            return product;
        }
Exemple #2
0
        public static IProduct CreateProduct(string productName)
        {
            IProduct product = null;

            switch (productName)
            {
            case "ConcreateAProudct":
                product = new ConcreteAProduct();
                break;

            default:
                product = new ConcreteProduct();
                break;
            }

            return(product);
        }