• 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

Factory Pattern - help needed !!!!

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
What exactly is the advantage of using Factory pattern ? When this pattern is useful ? Any useful tutorial(with examples) for Factory pattern ? Thanks in advance.

Ramdas.
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we are using factory pattern ,
when we want to genearalize the concept,
we can generalize by making an interfce.
i mean to say , making a core interface .called factory
and than extend it according to requirments
does it make some sense
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I don't want anyone to think that we have anything against the Factory pattern, because we don't! It's a great pattern, Gamma used it all the time

But, it's not on the SCWCD exam! For the exam you need to learn these J2EE patterns:

- Business Delegate
- Service Locator
- Transfer Object
- Intercepting Filter
- MVC
- Front Controller

If you see any other patterns mentioned on the exam you'll know that they are "distractor" answers, not the real answer!

hth,

Bert
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The factory pattern is a creational pattern. Think the follwing scenario to used factory pattern

1. When the class doesn't know which class of object to be create.
2. A class specifies its subclasses to specify which class object to be create.
3. Based the value the subclass decide to create the specified object.
reply
    Bookmark Topic Watch Topic
  • New Topic