S
Steve Howard
I have some global parameters that I want to apply throughout my
application. One is SoundOn, for instance.
I want to be sure that I am doing things the 'right way', so rather than
make assumptions, or take the first solution I find in the first web
reference I see, I'd like to ask here what the normal way would be to handle
such parameters.
I figured there would be two main possibilities :-
1, Write the parameter to the registry, and read it whenever it needs to be
used. Re-write it to the registry if it changes for any reason.
2, Write the parameter to the registry, read it once on startup and have
every interested form or object point to a global reference. Re-write it to
the registry if it changes for any reason, and update global reference at
the same time.
The first is obviously wasteful (potentially hundreds of registry reads per
session), but would certainly work. The second seems logical, but I don't
want to assume it's the best method.
Or is there another way?
If a global reference is used, is there a convention for doing so? For
instance would I build a special class that is used only for parameters?
TIA
Steve
application. One is SoundOn, for instance.
I want to be sure that I am doing things the 'right way', so rather than
make assumptions, or take the first solution I find in the first web
reference I see, I'd like to ask here what the normal way would be to handle
such parameters.
I figured there would be two main possibilities :-
1, Write the parameter to the registry, and read it whenever it needs to be
used. Re-write it to the registry if it changes for any reason.
2, Write the parameter to the registry, read it once on startup and have
every interested form or object point to a global reference. Re-write it to
the registry if it changes for any reason, and update global reference at
the same time.
The first is obviously wasteful (potentially hundreds of registry reads per
session), but would certainly work. The second seems logical, but I don't
want to assume it's the best method.
Or is there another way?
If a global reference is used, is there a convention for doing so? For
instance would I build a special class that is used only for parameters?
TIA
Steve