Design mode generator Mode

Source: Internet
Author: User

Generator mode: separates the construction of a complex object from its representation, so that the same build is too long to create different representations. Abstraction should not depend on details. Details should depend on abstraction. Therefore, the construction of a complex object must be separated from its representation so that the same construction can build different representations.
In my personal understanding, it is very important to abstract, encapsulate, and extract the construction process. Subclass inherits this abstract class and then implements it. The client is used to control the construction process, in this way, the association between users and specific construction processes is better isolated. The client only needs to provide what products I need, regardless of the specific implementation details.

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.