dotnet Schema (eight)--builder in the Framework source code (generator mode)

Source: Internet
Author: User
Tags dotnet generator

Separating the artifacts of a complex object from its representation allows the same build process to create different representations.

Builder (Builder) role: An abstract interface is given to standardize the construction of each component of a Product object. Generally speaking, this interface is independent of the business logic of the application. The direct creation of product objects in a pattern is the specific builder (concretebuilder) role. The concrete builder class must implement the method required by this interface: one is the construction method and the other is the result return method.

The specific builder (concrete Builder) Role: This role is a tightly related class of applications that create product instances under application calls. The main tasks of this role include: implementing the interface provided by the builder role, step-by-step through the process of creating the product instance, and providing an instance of the product upon completion of the construction process.

Mentor (Director) Role: The class that holds the role calls the concrete builder role to create the Product object. Directors do not have specific knowledge of the product category, the specific knowledge of the actual product class is the specific builder object.

Product role: A product is a complex object in construction.

To 2.0 System.Text with the. NET Framework. StringBuilder as an example

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.