wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Regarding factory patterns" Watch "Regarding factory patterns" New topic
Author

Regarding factory patterns

Paritosh H Chandorkar
Ranch Hand

Joined: Nov 11, 2012
Posts: 71
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: 50

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 : http://idiotechie.com/abstract-factory-design-pattern-explained/
factory method: http://idiotechie.com/design-best-practices-using-factory-method-pattern/

Hope this helps.


------------------------------------
Mainak
idiotechie
------------------------------------
 
Consider Paul's rocket mass heater.
 
subject: Regarding factory patterns
 
Similar Threads
Patterns: Abstract Factory Vs Factory Method
Difference between Simple Factory pattern and Factory Method pattern
Uses of Abstract Factory...
Abstract Factory and Factory Method
confused with Design patterns