[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

factory design pattern vs abstract factoy design pattern

Hi,

I would like to know what are differences between factory design pattern vs abstract factoy design pattern.

When to use which one. Advantages, disadvantages, practical uses of each. Please advise
0
gudii9
Asked:
gudii9
2 Solutions
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Nothing.

They are very similar names for identical concepts.
0
 
ste5anSenior DeveloperCommented:
Well, first of all: Use the correct names, cause this gives you already the necessary hint

It's Factory Method and Abstract Factory.

In short: Factory method is responsible to build one product (object). Abstract factory for building multiple products (objects). Factory method defines how the creation is modeled. Thus it is a description of it internals. Abstract factory focuses only on the visible interface. It's not about the internals. So abstract factory can use for it internals factory pattern. Which makes these often a little bit confusing. But it has not to use factory method. Builder would be an alternative.
2

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now