Design pattern Issues

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.