Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:51:43+00:00 2026-05-28T07:51:43+00:00

Fluent builder is a well-known pattern to build objects with many properties: Team team

  • 0

Fluent builder is a well-known pattern to build objects with many properties:

Team team = teamBuilder.CreateTeam("Chelsea")
    .WithNickName("The blues")
    .WithShirtColor(Color.Blue)
    .FromTown("London")
    .PlayingAt("Stamford Bridge");

However, using it doesn’t seem very clear to me due to one particular reason:

  • Every Team object has its minimal operational state, in other words, set of properties which have to be set (mandatory), so that the object is ready to use.

Now, how should the Fluent builder approach be used considering that you have to maintain this state?

Should the With_XYZ members modify the part of the object, that can’t affect this state?

Maybe there are some general rules for this situation?


Update:

If the CreateTeam method should take the mandatory properties as arguments, what happens next?

  • What happens if I (for example) omit the WithNickName call?

  • Does this mean that the nickname should be defaulted to some DefaultNickname?

  • Does this mean that the example (see the link) is bad, because the object can be left in invalid state?

  • And, well, I suspect that in this case the fluent building approach actually loses it’s "beauty", doesn’t it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:51:43+00:00Added an answer on May 28, 2026 at 7:51 am

    CreateTeam() should have the mandatory the properties as parameters.

    Team CreateTeam(string name, Color shirtColor, string Town)
    {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Fluent NHibernate and having some issues getting a many to many
I consider fluent interfaces very convenient for many tasks. But I feel uneasy when
Method chaining is the only way I know to build fluent interfaces. Here's an
NBuilder has two of the following fluent methods .Has(..) .Have(..) eg. return Builder<User>.CreateListOfSize(100) .WhereTheFirst(1)
I build fluent helper for build a html form in ASP MVC. But the
Fluent NHibernate Generates invalid columns names within a Many to one relationship. enter public
with Fluent NHibernate i can map a one to many relationship against my User
I'm using Fluent NHibernate (Auto Mapping) to map my domain objects to database tables.
Fluent Nhibernate Many to Many association to multiple classes We use Nhibernate and up
Using Fluent Interface design here if i call something like dog.Train(Running).Train(Eating).Do(Running).Do(Eating); what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.