This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 753
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
Settling out which factory pattern EJBHome uses
Thinking wild
What is the difference between AbstractFactory and Factory pattern
confused with Design patterns
Abstract Factory Pattern Vs Factory Pattern