Home  /  Questions  /  Question

50   50
Jun 18, 2013

I need some Design Pattern advice

Hi All,

I'm in the process of modifying an application. I'm writing a set of classes for different storage systems (database etc).
In order to interact with the different systems each class will require particular pieces of information to connect to the store.

What I'm looking at doing is having each provider implement a method that returns a Question<t> class.  So lets assume that I want to ask the user for a database username this would resolve to Question<string>. What I'm then looking at is having a factory to create/return each type of closed generic class I need.

One question follows on from the above architecture: Should I have each concrete class implement it's own processing logic (i.e to ask the user via a command line) using the command pattern or is there a better way of doing this?

Any help much appreciated.

72   96.1
Jul 11, 2013
I am not sure I understand the question.
Why would you query the provider?  Why not store this information globally in a simple cache or file?
It seems to me that you are making things more complicated than they have to be.