B
bg_ie
Hi there,
In my application I have a Settings class which has two objects,
userSettings and defaultSettings. When the application starts, I use a
deep copy to set-up userSettings with the values found in
defaultSettings. This was an akward process, as the Settings class
contains many Lists, some of which contain Lists themselves, and so
on. As the program executes, the userSettings object is updated. Then
when the program is exited, I use a deep comparison of my two objects
to check if their constituent values are equal. If not, the user is
asked to save their own version of the settings.
Is this a good approach and if not, how would you go about doing this?
I took some time to write the deep functions and I have yet to test
them fully. A lazy, but less bug prone approach perhaps to the deep
copy issue would be to deserialize defaultSettings and serialize the
result to userSettings...
Thanks for your help,
Barry.
In my application I have a Settings class which has two objects,
userSettings and defaultSettings. When the application starts, I use a
deep copy to set-up userSettings with the values found in
defaultSettings. This was an akward process, as the Settings class
contains many Lists, some of which contain Lists themselves, and so
on. As the program executes, the userSettings object is updated. Then
when the program is exited, I use a deep comparison of my two objects
to check if their constituent values are equal. If not, the user is
asked to save their own version of the settings.
Is this a good approach and if not, how would you go about doing this?
I took some time to write the deep functions and I have yet to test
them fully. A lazy, but less bug prone approach perhaps to the deep
copy issue would be to deserialize defaultSettings and serialize the
result to userSettings...
Thanks for your help,
Barry.