In designing .NETOOP we have this issue:
Since .NETOOP will be an adaptable application designed to meet the needs of many users, some of the things that one might hard code in an application like “Web Site Name” will need to be set at installation time.
For “system” configuration settings we have the web.config file.
For language and culture variations we have resource files.
But this type of site configuration doesn’t really fit nicely into either of these categories.
We could use…….
- .res files
- .xml files
- a table in the database.
There are a number of considerations.
- Since these are not really the same kind of configurations issues that we normally put in the web.config file (like a connection string) it would seem that web.config is not the right place for them and it’s a good thing to minimize the number of times someone edits the web.config file. Even if we created web UI for editing these settings folks will hand edit it. It might grow large and I don’t even know you you can store MCBS strings in the web.config.
- We could use resource files and create/edit them via System.Resources, but these file would not be “hand editable”.
- .xml files are easy to edit but in an environment where the database and the web server run on different machines, I/O from a database will probably be faster. (Especially in lower end shared hosting environments.)
- We could use a hybrid approach when edits are made in an XML file and imported into a database.
- We could address performance issues by using one of the many ASP.NET caching facilities and storing some commonly used items in application state (like site title.)
Please take the poll at http://twtpoll.com/st6sa4.
I’m hoping to do some coding on this issue TONIGHT !