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

  • Home
  • SEARCH
  • 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 8355161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:46:55+00:00 2026-06-09T09:46:55+00:00

Possible Duplicate: Constructor vs. Factory in .NET Framework I understand factory patten and have

  • 0

Possible Duplicate:
Constructor vs. Factory in .NET Framework

I understand factory patten and have implemented it but couldn’t get what benefit it will bring. For example instead of:

MyType1 obj=new Mytype1();
MyType2 obj=new Mytype2();

writing:

IMyType obj1 = Factory.Create(1);
IMyType obj2 = Factory.Create(2);

Is it something I have missed or not conceive. Can you please put your own experience example.

  • 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-06-09T09:46:57+00:00Added an answer on June 9, 2026 at 9:46 am

    Some benefits of the factory pattern:

    1. You can keep track of the objects you create. If you want to re-use objects or enforce a limit on the number of objects created, the factory can enforce that.
    2. You can control how objects are created. If there are some parameters used to create the objects, you can return an existing object when clients pass in the same parameters for an object that has already been created.
    3. You can have the factory return an interface but internally create different types of objects that support the interface.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Interface defining a constructor signature? I have a mixed hierarchy of classes
Possible Duplicate: ASP.NET MVC: No parameterless constructor defined for this object I'm working on
Possible Duplicate: question about copy constructor if I have this snippet of the code
Possible Duplicate: Java - Leaking this in constructor In the NetBeans I have a
Possible Duplicate: Should I initialize variable within constructor or outside constructor I have here
Possible Duplicate: C++ invoke explicit template constructor First imagine I have a class Data
Possible Duplicate: Is the C# static constructor thread safe? I have multiple threads using
Possible Duplicate: What is your threshold to use factory instead of a constructor to
Possible Duplicate: Calling virtual function of derived class from base class constructor? I have
Possible Duplicate: Copy Constructor is not invoked # include <iostream> using namespace std; class

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.