views:

37

answers:

1

For a CMS product/platform, what would be a maintainable and clear approach for editing and storing settings?

I'm not talking about technical (connstring, nh config, ...) settings, but settings that alter the behaviour of the product:

These settings are for example

  • Online Payment settings
  • Available parts and modules
  • Default behaviour of the application (showing details of list items by default, default landing page after certain actions)
  • ...

At this point we don't really have an approach, so the result is that all settings end up in the web.config.

This is probably not the best approach, since this is simply ending in an endless list of obscure key value pairs...

In this scenario we also cannot really anticipate to types (without codegen), so settings with checkboxes or predefined options... are hard to manage.

Another option would be to create the needed tables for each setting (type) and use that as a core setting system, but this will be harder to deploy and manage per customer.

I have lots of half answers to this question but not really a top down solution...

What I mean by top down:

  • Editing settings (admin screen)
  • Where to persist the settings
  • Loading the settings, without much hassle, but still in a maintainable way
  • Maintain/deploy customer specific settings

So options so far:

  • (web).config
  • .settings files
  • DB

But these are all kind of key-value approaches... Any other suggestions?

A: 

You could write a custom configuration section which allows you to store much more than key/value settings in the config file. This being said the config file is designed for read-only settings. If you need editing functionalities with admin screens then it would be best to use database. Storing this information in files is also a possibility but as this is a multi-threaded application you will need to properly synchronize access to those files which could quickly become cumbersome.

Darin Dimitrov