This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding factory patterns

 
Paritosh H Chandorkar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic