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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:05:44+00:00 2026-05-22T12:05:44+00:00

Here is my factory-method class. public class AFactory : FactoryBase { public override ProductBase

  • 0

Here is my factory-method class.

public class AFactory : FactoryBase {
        public override ProductBase ProduceProdut() {
            return new SuperCoolProduct();
        }
}

Here is my builder class.

public class ABuilder : BuilderBase {

        ProductBase product = new SuperCoolProduct()

        public override void BuildStep1() {
             //Do Something (e.g. product.Add() )
        }
        public override void BuildStep2() {
             //Do some more...(e.g. product.AddMore() ) 
        }

        public override ProductBase GetFinalProduct() {
            return product;
        }
}

My questions are the following ~

1) Does the builder has to expose some methods that the Director can call for compositing the product?

Can this class still be considered as a builder class? Or, Do we have to call it as a factory class? I think that we can’t call this class below as a builder anymore and it’s a factory class now..

public class ABuilder : BuilderBase {

            ProductBase product = new SuperCoolProduct();        

            public override ProductBase GetFinalProduct() {
                BuildStep1();    
                BuildStep2();

                return product;
            }

            private void BuildStep1() {
                 //Do Something (e.g. product.Add() )
            }
            private void BuildStep2() {
                 //Do some more...(e.g. product.AddMore() ) 
            }

    }

2) Would the code below be a good example of combining “Builder” pattern and “Factory Method” pattern?

public class AFactory : FactoryBase {

                BuilderBase builder;

                public AFactory(BuilderBase builder){
                   this.builder = builder;
                }
                public override ProductBase ProduceProdut() {
                    this.builder.BuildStep1();
                    this.builder.BuildStep1();
                    return this.builder.GetFinalProduct();
                }
        }
  • 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-22T12:05:45+00:00Added an answer on May 22, 2026 at 12:05 pm
    1. Yes
    2. I would call it a director. But yes. You could call it a factory method implementation.

    As for factories: It’s more common to call the methods CreateXXX

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

Sidebar

Related Questions

I have a generic object factory FactoryBase<T> with a factory method: public abstract class
Here is a simple example: class Class_A { protected $_property; public function method() {
Is it possible in Java to create a static factory method/class that uses an
I am new to SQL Server 2008 fill factor, as mentioned here in SQL
I'm working on legacy code that looks very similar to this: public class BaseParser
I have a CustomerRelation class which has a method getInstance() and instance variable i.e
I'm trying to build a factory method that uses the generics feature of C#.
I have a Factory class that creates a Widget object. The Factory object needs
I am trying to come up with a method factory that looks inside config
I have an interesting problem. Consider this class hierachy: class Base { public: virtual

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.