Class usable from all other class
- From: "Geoffrey" <AEnlevergeoffrey@xxxxxxxxx>
- Date: Mon, 16 Jan 2006 10:36:27 +0100
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
.
- Follow-Ups:
- Re: Class usable from all other class
- From: Marc Gravell
- Re: Class usable from all other class
- From: Frans Bouma [C# MVP]
- Re: Class usable from all other class
- Prev by Date: Re: using trigger in C# Windows Form
- Next by Date: Re: Tool to generate properties from private fiels
- Previous by thread: C# Windows Form Globalization format problem
- Next by thread: Re: Class usable from all other class
- Index(es):
Relevant Pages
|