Different Approaches to Saving settings: Which is better?

  • Thread starter Thread starter Martin the Third
  • Start date Start date
M

Martin the Third

Okay, I have a program that has many optional windows. Its not mdi or
anything, it just has alot of windows that you can choose to have that
would add extra features to the program.

Now, I need to have the properties of these windows to stay when the
user exits (which windows are opened/closed, etc). Ive already set it
up so that it reads and writes from an xml file to handle all this.

The problem is that the variables I have set up dont get told when to
change (Id go into greater detail, but it's irrelevant). Anyway, the
two options I have to fix this problem are as follows:

1) Send strings in the form close events to the main window, and change
the variables that affect the settings. Then write to the xml file when
the entire program is exited with a subroutine.

2) Make the read/write xml subs part of a seperate class, and write to
the xml file any time a window is opened or closed.

Which would be more efficient?

Thanks in advance,
-m3
 
Martin said:
Okay, I have a program that has many optional windows. Its not mdi or
anything, it just has alot of windows that you can choose to have that
would add extra features to the program.

Now, I need to have the properties of these windows to stay when the
user exits (which windows are opened/closed, etc). Ive already set it
up so that it reads and writes from an xml file to handle all this.

The problem is that the variables I have set up dont get told when to
change (Id go into greater detail, but it's irrelevant). Anyway, the
two options I have to fix this problem are as follows:

1) Send strings in the form close events to the main window, and change
the variables that affect the settings. Then write to the xml file when
the entire program is exited with a subroutine.

2) Make the read/write xml subs part of a seperate class, and write to
the xml file any time a window is opened or closed.

Which would be more efficient?

Thanks in advance,
-m3

Have each window have it's own xml file. That the window is only
adjusting it's own file and will be efficient since it can write out the
minimal amount of information.
 
Martin,

Both not, I keep this forever as lead for this kind of question.

Everything that affects the computer and belongs to that Registry, in my
view belong the form sizes than to the registry which can be used to set the
properties before the show and back to the registry before the close.

Everything that belongs to the application would in my opinion be set in the
config (xml file). To be transportable.

Just my thought,

Cor
 
How is that different from having them all write to the same one? It
seems like creating a bunch of xml files would be less efficient.
 
Back
Top