One
The following statements about static Factory and factory methods are incorrect: ()
A. In the plant method model, for product trees that have inheritance hierarchy, the product is created by a factory of the corresponding hierarchical structure
B. Failure to form a static factory inheritance structure
C. Static factory judgment on the creation of specific products and the timing of creation is mixed together, which in the factory method
D. Both meet the open and closed principle: Static factory creates objects in the If Else mode and modifies the source code when the demand is increased
Select D, open and close principle: Opening to the expansion, closed to the modification. Static factory add need is to modify the source code, the modification is not closed, does not conform to the opening and closing principle.
Design pattern Issues