views:

15

answers:

2

I have a fairly complex winforms application and I m contemplating storing my config data in a sqllite db file rather than the ususal regular app.config/ xml files.

The reasons being -

  1. Data in a db is more resilient to accidental changes by administrators.
  2. I can easily conjure up a data entry form to manage configuration.
  3. The same db can be used to store user settings.

Does this make sense. Is there something that I am overlooking? Are there other better options out there? Has anyone tried to use object databases to do this?

-ilias

+1  A: 

I think that if you have to protect your configuration from administrators, that's a bigger problem than how you store your config :)

as for easily editing configuration, .net does offer the ApplicationSettings mechanism, which I've always found to be pretty straightforward. http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx

You can have multiple app.config-like files and each of which can be wrapped in a settings object.

Not saying the database option is worse or better than this, just that you have all of the mechanisms (and syntactic sugar) already available to you built into .NET, with the advantage of you not having to deal with also importing and supporting sqlite (or whatever you chose)

Oren Mazor
+1 regarding the configuration ... smells like 'security through obscurity'
overslacked
A: 

Just addressing the specifics of your points:

  1. Data might be more resilient, but configuring an installer to apply changes, or allowing system administrators to push changes out to client installs becomes almost impossible.
  2. .NET is pretty good with data sources; whether you use a DB or an XML file, building the entry form is the same level-of-effort.

Basically ... DBs, even the small ones like SQLite and SqlServerCE, are a headache of their own and probably not worth it for the scope of the problem you're describing.

overslacked