Less than 42 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When to use Factory and when to use AbstractFactory ?  RSS feed

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was going through the factory and abstract factory design patterns... Both patterns looks similar, both are used for object creation.

When to use Factory Pattern & When to use Abstract Factory ?

I am still little confused about AbstractFactory pattern. What is the relation of AbstractFactory and Factory Pattern ?

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AbstractFactory implementations may consist of a way to obtain multiple "concrete" factories which then are used to create similiar but different objects. It is a more complex implementation than using a simplified Factory Method implementation.

The decision to use one or the other depends upon (1) your understanding of the patterns and their various applications, and (2) the needs the application you are designing, or in other words the requirements.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!