示例#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;
        }
示例#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);
        }