-
Notifications
You must be signed in to change notification settings - Fork 4
Ubiquitous Language
The instance constructed by calling build() on a fluent builder
An object that is used to build an instance of another type
See Builder
The type (class) of object a builder creates
A builder whose interface is custom designed. This is usally to create a more fluent interface that does not require the use of lambdas. Great for creating DSLs. Opposite of Dynamic Builder
- When you want full control over the fluent interface.
- When you don't want to see lambdas in your fluent interface
- When creating public DSLs that are user-facing
- When you don't want the Target Type's properties and methods visible to the user of the fluent interface
- Can specify custom default values to use for each property
- Must create a custom builder as a subclass FluentBuilder (FluentBuilder is an abstract type)
- Must implement custom methods to set property values through the builder
- No access to the standard For, Having, & With methods that exist in the Dynamic Builder
- Can perform custom processing on the build result before returning it (Override AfterBuild() in the custom builder)
Builder that uses Fluency's interface and lambdas to set the values of the build result. Opposite of Custom Builder
- When you don't mind lambdas in your fluent interface
- When the provided lambda accessors (For, With & Having) are sufficient for your needs
- When creating internal DSLs that are not user-facing
- When you don't mind the Target Type's properties and methods being visible to the user of the fluent interface
- Provides lamba accessors For, With, & Having to set property values on the builder.
- Do not need to create a subclass to use. DynamicFluentBuilder is a able to be instantiated directly
- Cannot perform custom processing on the build result before returning it.
Builder that is included in Fluency that is specialized to build lists of objects Is implemented as FluentListBuilder where T is the type of item to include in the list. The build result is of type IList Anytime you have a property that is a list, you wil need to use a list builder to populate its values.
An alias refers to a builder that simply returns a specified instance. The builder is said to be an "alias for" that instance. Use builder.AliasFor( instance ) to set a builder as an alias. Warning: when a builder is set as an alias, any previous calls to configure the build result are ignored, and any subsequent calls to configure the build result should fail.