File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Regarding factory patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Regarding factory patterns" Watch "Regarding factory patterns" New topic

Regarding factory patterns

Paritosh H Chandorkar
Ranch Hand

Joined: Nov 11, 2012
Posts: 89
Hello All,

What is the exact difference between Abstract Factory and Factory method design patterns?
What is the difference in their application?

Can someone explain me this point.

Thanks and regards,
Paritosh Chandorkar
Mainak Goswami
Ranch Hand

Joined: May 21, 2006
Posts: 52

You can consider the abstract factory pattern as parent of factory method pattern...basically the abstract factory represents multiple factories and provide a single view to the client.
Abstract Factory Design Pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes.

example in j2ee:
Data Access Object in JEE uses the (GoF) Abstract Factory Pattern to create various product DAO from RdbDAOFactory, XmlDAOFactory, OdbDAOFactory.

Tried to explain with example in the following articles:
abstract factory :
factory method:

Hope this helps.

I agree. Here's the link:
subject: Regarding factory patterns
It's not a secret anymore!