• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diffrence of design patterns

 
rottscha rotti
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
what is the diffrence between the "abstract factory" and the "factory mathod" pattern ?

Thanks rottscha
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rottscha,

Abstract Factory creates a family of objects, like Concrete AbstractFactoryA will create ConcreteProductA1, ConcretProductA1. Whereas, AbstractFactoryB will create ConcreteProductB1, ConcretProductB1.

Factory Method has a special method to create an object. Like the create method of session home.

Lucy
 
jono
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

As lucy said........

The factory method allows you to abstract the creation of an object from it's implementation. You provide a defined interface method but the implementation is in a different class which can vary depending on requirments.

The point of an abstract factory is that once you select the factory, all product you create through that factory will be from a single "family set" - you can't accidetnally create one class from one group and one class from another
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jono

Unfortunately your name does not comply with our naming policy. Please take a quick look at the rules and edit your profile accordingly.

Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic