• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Uses of Abstract Factory...

 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Creational Patterns, where we can use Abstract Factory patterns. what is the diff. b/w Abstract Factory and Factory method.
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Imagine supporting two windowing environments, Microsoft Windows�and the X Window System.
Create an Abstract Factory class WindowFactory defining methods like #createButton. Add subclasses MSWindowFactory and XWindowFactory which implement #createButton to answer instances of MSButton or XButton respectively. A window painter can then be given an instance of MSWindowFactory or XWindowFactory. Sending it the #createButton message will result in an instance of MSButton or Xbutton. Assuming they respond to the same protocol, the client can remain ignorant of the class of the resultant button.
Abstarct Factory Class: WindowFactory
FactoryMethod(s): newWindow() which will return either MSWindowFactory or XWindowFactory. and createButton().
 
reply
    Bookmark Topic Watch Topic
  • New Topic