Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1 KB

Fluent Builder.md

File metadata and controls

21 lines (15 loc) · 1 KB

Overview:

A fluent builder is a builder that contains a method which returns the builder instance intself. This allows you to perform method chaining. You can tell if a builder allows for this by checking the return type of the instance methods. In OOP this is a common design, and it is called a Fluent Interface.

Types participating in this pattern include:

  • FluentBuilder

    • Provides an fluent interface for continually accessing builder methods to build out the product
    • Designs and keeps track of the representation it creates (Contains a single Instance of the product)
  • Product

    • Represents the complex object under construction
    • FluentBuilder builds the product's internal representation

Sources:

Design Patterns in C# and .NET - Builder: Fluent Builder

image