Click to See Complete Forum and Search --> : Windows Registry - but why?


Deniz
March 17th, 2004, 05:57 PM
Hey "gurus" I got one for yas

Is there really any advantage to the windows registry in terms of it being used by my application?

My app uses a .dat system settings file where everything is stored. I could try creating a new section in the registry but I dont get it, is it better? If so, how? Is it really more hassle than its worth?

Thanks for your help! :wave:

Kheun
March 18th, 2004, 03:00 AM
I believe a reason for using the registry is to keep only a copy of your program data at a well known place. If data file is used, you may end up with multiple copy of the same thing cluttering in different directories.

Yves M
March 18th, 2004, 11:37 AM
Also, the registry is useful if you want to have machine-wide settings and user-specific settings. If your configuration options need a lot of space, a data file may do just as well though.

Sam Hobbs
March 18th, 2004, 01:30 PM
I think if you already have something working then you are probably qualified to answer this question as much as we are. In other words, there is probably not anything beyond the obvious considerations.

JMS
March 18th, 2004, 02:01 PM
Obviously as has been stated it will allow multiple copies of your program which exists on a machine to all reffer back to a single place for configuration parameters. But that begs the question as to why you would want multiple copies of your program if they're all going to use the same settings.. I think a .dat file or an old .ini file which allows every installed program to taylor their configuration is at least as useful as locking one in to global settings.

I believe the real reason Microsoft rammed the registry down everybodies throat was a little more simplistic. If you have an ini file or a .dat file located on your HD when a program is coppied one can just copy the entire directory and Wham they've got a working instance. The Registry is a security wall/fence. Since registry settings are opaque to say the least and not tied the the process or binary name and not necessarily even located in the same branch of the heirachical tree, they are more difficult to copy when trying to copy an instal. I believe that was and remains the top argument for the registry.

Registries can now be remotely kept in synch and some programs and programming techniques like COM/DCOM rely heavily on it. Which are all extra arguments. Still if you've ever corrupted the registry by trying to add an extra paramerter to one of your com interfaces or if you've ever accidentally deleted a program with an unknown file association then you will appriciate exactly how fragile and infuriating the registry can be...

I veiw the registry as the clasic example of fixing a problem which wasn't ever thought to be broken with regard to software users and developers. Software companies probable feel differently about this.

Good luck...

sleeping
March 18th, 2004, 02:33 PM
I would also mention that developping an application that relies on the registry limits you to the Win32 platform. If you ever plan on porting your app on Mac or Linux or other, then you need to stick to the ini file because there is no such thing as a registry on those platforms.

Deniz
March 18th, 2004, 06:09 PM
I reckon it all comes down to M$ coming up with a quote great idea unquote to make sure we use M$ and destroy any thought of porting products on grounds it would be to much of a hassle.

If it is about security like JMS said then it may be a good idea but not essential.

My application, for example, needs special hardware to run and theres only one copy on one machine, so it is really pointless to make it harder to copy. Plus we got security measures in place anyway.

Sam Hobbs
March 18th, 2004, 08:27 PM
Originally posted by sleeping
I would also mention that developping an application that relies on the registry limits you to the Win32 platform.I would also mention that developping an application that relies on the Windows GUI limits you to the Win32 platform.

dimm_coder
March 19th, 2004, 11:32 AM
Originally posted by Deniz

If it is about security like JMS said then it may be a good idea but not essential.

My application, for example, needs special hardware to run and theres only one copy on one machine, so it is really pointless to make it harder to copy. Plus we got security measures in place anyway.

That's not a big problem. It's quite easy to find by some way all entries used by an application.

The Registry is considered to be a place where lots of system critical information is concentrated. Physically, the registry is a set of files on disk (some amount of data is cached while the system is working). Some application stores just a few params, another may store much more.
When the registry becomes big, the performance of each application, reading params from the registry, is degradated. Regardless if it stores (and need to read) just a few params (because some other application wrote megs to the registry).
And there is a security flaw to store all information in one place.