Store Global variables in a hashtable

J

Jack Wright

Dear All,
I am designing a WinForm Application and would like to keep track of
all the Global variables declared in my application. The logic for
this that I have in mind is to create a class that has a hashtable and
all application programs store their variables in a hashtable by
calling my class functions...Is this a good design for storing global
variables in a WinForm application? Or are there better ideas?

Please help

Many Regards
Sunil
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Jack Wright) scripsit:
I am designing a WinForm Application and would like to keep track of
all the Global variables declared in my application. The logic for
this that I have in mind is to create a class that has a hashtable and
all application programs store their variables in a hashtable by
calling my class functions...Is this a good design for storing global
variables in a WinForm application? Or are there better ideas?

Something like this?

<URL:http://www.palmbytes.de/content/dotnet/optionslib.htm>

Notice that the text is written in German, but the downloads are written
in C#.
 
S

Saurabh

You shouldn't need lot of global variables at all in your application. If
you are talking of some application wide settings / preferences, then I
think your approach is a good way of dealing with it.

--Saurabh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top