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 7525805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:39:14+00:00 2026-05-30T03:39:14+00:00

In most tutorials (Judith Bishops’ book, or here ), I see example similar to

  • 0

In most tutorials (Judith Bishops’ book, or here), I see example similar to the one below.

If the builder pattern means to create method Construct in Director class, which performs set of Builder childs operations…

class Director {
  public static void Construct(Builder builder) {
    builder.BuildPartA();
    builder.BuildPartB();
    ...
  }
}

abstract class Builder {
  public abstract void BuildPartA();
  public abstract void BuildPartB();
  ...
}

class Builder1 : Builder { ... }
class Builder2 : Builder { ... }

void Main() {
  Builder1 b1 = new Builder1();
  Builder2 b2 = new Builder2();
  Director.Construct(b1);
  Director.Construct(b2);
}

…why don’t we just move the Construct method to the Builder class?

class Builder {
  public virtual void BuildPartA();
  public virtual void BuildPartB();
  public void Construct() {
    BuildPartA();
    BuildPartB();
    ...
  }
  ...
}

class Builder1 : Builder { ... }
class Builder2 : Builder { ... }

void Main() {
  Builder1 b1 = new Builder1();
  Builder2 b2 = new Builder2();
  b1.Construct();
  b2.Construct();
}

Please show me some example where the builder pattern is really helpful.

  • 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-30T03:39:15+00:00Added an answer on May 30, 2026 at 3:39 am

    The Directory is supposed to know the correct sequence of assembling different components to construct the objects. I believe it is simply to separate the concern of knowing the order or method of constructing these objects from the base Builder class (which is simply a base class). If you moved the construct into the Builder base it would resemble the template method pattern.

    It is better to have a separate director that knows how to assemble the components because in the even that the “recipe” of constructing the components changes, the base class does not need to be changed. For example, let’s say a certain class of components need to be built by executing 3 steps in a certain order:

    1. Step A
    2. Step B
    3. Step C

    Let’s say at some point another component is added to the family which can be built with the same steps but in a different order:

    1. Step A
    2. Step C
    3. Step B

    In this case, if the logic for the sequence is separated in the Director as opposed to the base class Builder, one can inherit a new director and use that to construct. If the logic was in the base Builder, the base class, which may be a part of a separate library or JAR or a header file in case of C++, it may have required recompilation of the concrete classes or at least shipping a new JAR.

    I’m sure there are more advantages of separating such a concern.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Most tutorials propose a default JSF configuration similar to the following web.xml: <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
I've just begun using LINQPad and so far I like it but most tutorials
been working with symfony for a while. most tutorials describe having multiple actions in
Most of the tutorials around explain how to create a java applet: create a
Most dead-tree books and web tutorials address Rails 1.X. I'm wondering if they are
There are thousands of vi tutorials on the web, most of them generically listing
I'm looking for a good introduction/tutorial for unit testing C#. Most tutorials I've come
I have a navigation controller with a table view. In most tutorials I've read
I have googled for it and most tutorials are cryptic. Can somebody teach me
Most Rails tutorials show how to populate a model class via the params hash

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.