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

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.
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic