• 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

Pattern for object creation & usage thru a parameter

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have this case;

For the moment I have a DataAccess class (let's call it DA 1) that communicates with an Oracle database.
Now I need a second DataAccess (DA 2) which does all the same stuff except with a User Archives database (PCS7)

Based on a parameter in a config file I will create an instance of DA 1 or DA 2.

I know how to do this technically (with an interface) but I was wondering .. isn't there a Design Pattern for this?

thank you!
 
Nico Van Brandt
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, it was the Simple Factory Pattern that I was searching
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. Thanks for posting the solution.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nico Van Belle wrote:
I know how to do this technically (with an interface) but I was wondering .. isn't there a Design Pattern for this?

thank you!

I'm curious to ask, if I may, why do you feel that you need a design pattern for something like this? Realistically speaking does it offer something to you that your own solution does not?

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic