Tuesday, May 3, 2011

User-specific settings files for a windows form application: local xml file or database

My coworkers and I cannot seem to agree on a solution to the following issue:

We are working on moving our application to the .net framework. It will be a standalone application (not a web application) that will consist of many custom forms used for making changes to our extensive database. So, in summary, without a database connection, the application is pretty much useless. Oh--and there's no need to suggest making this a web application because there is really no choice in the matter.

I am responsible for building the "main menu"--I've decided on a tree structure that will list all the custom forms (categorized by team). It will also include a "My Forms" section and a "Recent Forms" section that will be changed by the user (my forms) and the system (recent forms) on a regular basis.

My question is this: what is the best place for storing these custom user-specific-settings? An XML file located locally or in tables located database? Maybe it's because I'm a former web app developer but I'm totally for having this stored on the database. What do y'all think?

Thanks for your opinions

From stackoverflow
  • If the user can function without the database they should be a local xml file. If the app requires the database to be functional, I'd add them to the database. Why add some new concept to the app, just keep storage of data in a single place. Your app will be able to run with lower privileges as well. If you're using the asp.net membership model (yes, for the desktop app) then you'll be able to take advantage of the profiling.

    I vote database!

  • Another advantage of keeping them in the database is that when the user logs in to your application from another computer, all of their settings will be preserved. If they are stored on the local machine, moving to another machine would cause them to lose their settings.

  • It can be troublesome to mix user settings and user data in the same storage location.

    • This approach will basically double the number of times the database structure has to change.
    • If there is a bug in the settings code, there is a chance to corrupt/lose user data which is much more serious than corrupting/losing a user setting.
    • If the user wants to move or back up their data, the settings are also carried with it.

    I would advise against keeping the settings in the database.

0 comments:

Post a Comment