• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

diffrence of design patterns

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,
what is the diffrence between the "abstract factory" and the "factory mathod" pattern ?

Thanks rottscha
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic