Re: Writing to registry
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Fri, 20 Jan 2006 08:40:08 -0600
"Gary Nelson" <gn@xxxxxxxxxx> wrote in message
news:OU7Fd3ZHGHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
> Ralph,
>
> >
> > I agree.
> >
> > One should never ignore the importance of clearly delimiting
> > properties/attributes/options/defaults as to whether they concern the
> > Application-at-large or a specific user.
>
> I thought we were talking about user specific
> 'properties/attributes/options/defaults'
>
> > Lumping them together only causes
> > confusion and trouble down the road - when you attempt to administer,
> > upgrade, or backup the application; when you need to migrate to a
multiple
> > user scenario; or when addressing security issues.
>
> I thought we were talking aboout a multiple user scenario.
>
> > I keep harping on this subject as it one of my biggest pet peeves with
> > OPAs
> > (Other People's Applications). Applications developed by programmers who
> > don't recognize the difference become become a PITA to migrate to a
> > distributed environment.
>
> As far as I know HKLM is for default values for all users on a specific
> machine, and which are read only if we are talking about a limited user.
> HKCU is for user specific settings. Am I missing something here?
>
> Gary
>
At some point all these conversations wander into 'meanings' and specific
scenarios, and perhaps just plain ole preferences. (eg, we could wrangle all
day on whether these items are defaults, properties, or attributes.)
I am uncomfortable with your expression "All Users" - you always have either
TWO separate sets of values - those that a particular User is interested in
and those that the App is interested in. I feel thinking of the latter as
"All Users" will lead one astray. As in this case where you are essentially
duplicating (creating two tables) for the same data. That is just plain
wrong in any scenario. (Dr. Codd must be rolling in his grave. <g>)
Exactly what would go into those two separate arenas - will vary greatly and
certainly wouldn't be cut 'n dry for all situations. For example, since I
use large monitors and tend to tile current working sets, I always build in
saved start-up positions. Apps that don't -tend to annoy me. That is obvious
a 'User' default. However, you might be distributing a corporate utility
that, the powers that be, have decided must always open in the upper right
corner - that would be a 'App' default.
In the same vein one needs to decide if such items need to belong in the
registry or not. [I am in agreement with you considering the Registry, it
isn't as fragile as many would have you believe, but it is a shared resource
and isn't infinite. Good practice is to always avoid a shared resource when
possible.] In my startup scenario above - since such values are read/write
basically only twice (start-up and quit) why use the registery? - a simple
ini file in a common folder will do quite well. Again we need to determine
if \user\Application Data, \Prog~Files\Common Files\, or \Prog~Files\MyApp
would be a better fit.
However, if I had a scenario where I was launching multiple instances of my
app and wanted to manage various 'shared' items uniquely for each (eg, a
default property screen, tab, or dataview) I would likely use the registry
as it is a bit quicker and more flexible during runtime.
It is a subtle shade of grey - but essentially NO the HKLM is NOT for
default values for all users on a specific machine. It is for specific
values for that App on that machine.
-ralph
.
- Follow-Ups:
- Re: Writing to registry
- From: Gary Nelson
- Re: Writing to registry
- References:
- Writing to registry
- From: Jack
- Re: Writing to registry
- From: Gary Nelson
- Re: Writing to registry
- From: MikeD
- Re: Writing to registry
- From: Ralph
- Re: Writing to registry
- From: Gary Nelson
- Writing to registry
- Prev by Date: Re: Switching between 2 forms
- Next by Date: Re: Need to print all files from a folder
- Previous by thread: Re: Writing to registry
- Next by thread: Re: Writing to registry
- Index(es):
Relevant Pages
|