Class usable from all other class

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

Form my software, I create a class to manage configuration.
Configuration parameters are retrieved from wml file, ini file, registry,
....

For this, I have a constructor that create a dataset with all my parameters,
and I have a method "getParameter" that return a value of a parameter ...
This class can do other think like modify parameter, display a usable list,
....

When I have a lot of class on my project, I must use an instance of my
configuration class in each of the class that would use it.

So, I have lot of instance of the same class ...

In c#, it's not possible to declare a global instance of this class.
And want to have a constructor (so impossible to have statict method) to
retrieve all parameters.
I don't want to have a static method that allways read configuration files
to retrieve a parameter.


What is the best design to do that ?
Allways create new instance on each class ?

Thx


.



Relevant Pages

  • Re: Problems with Kmail
    ... to refusing the connection during authentication. ... the account, I still could not retrieve mail (yes, this was on the ... had to go into the KMail account configuration and re-enter the password. ...
    (alt.os.linux.suse)
  • Re: Class usable from all other class
    ... I create a class to manage configuration. ... > And want to have a constructor (so impossible to have statict method) ... > I don't want to have a static method that allways read configuration ... > files to retrieve a parameter. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How save modem configuration correctly
    ... use lineGetDevCaps() to retrieve the dwPermanentLineID from the ... associated with a modem's configuration. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: ConfigurationManager, user settings and application settings
    ... 1 to retrieve from Application Data folder ... > data should be under the application's installation directory. ... > user configuration or per application. ...
    (microsoft.public.dotnet.framework)
  • Re: Java Logger
    ... I am not using a console Handler in the code, ... it is not Java code. ... reading in the initial configuration. ... In other words, copy the code posted by Knute to the constructor of a class, say ...
    (comp.lang.java.programmer)