It's not a secret anymore!*
The moose likes OO, Patterns, UML and Refactoring and the fly likes When to use Factory and when to use AbstractFactory ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "When to use Factory and when to use AbstractFactory ?" Watch "When to use Factory and when to use AbstractFactory ?" New topic
Author

When to use Factory and when to use AbstractFactory ?

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
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 ?


Jigar Naik


Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When to use Factory and when to use AbstractFactory ?
 
Similar Threads
What is the difference between AbstractFactory and Factory pattern
Settling out which factory pattern EJBHome uses
confused with Design patterns
Thinking wild
Abstract Factory Pattern Vs Factory Pattern