对于CMS产品/平台,用于编辑和存储设置的可维护和清晰的方法是什么?
我不是在谈论技术(connstring,nh config,...)设置,而是改变产品行为的设置:
这些设置是例如
在线支付设置 可用的零件和模块 应用程序的默认行为(默认显示列表项的详细信息,某些操作后的默认登录页) ...在这一点上,我们并没有真正的方法,所以结果是所有的设置都会在web.config中结束。
这可能不是最好的方法,因为这仅仅是无尽的密钥值对列表的结尾......
在这种情况下,我们也不能真正预测类型(没有codegen),所以带有复选框或预定义选项的设置很难管理。
另一个选择是为每个设置(类型)创建所需的表格并将其用作核心设置系统,但这对于每个客户的部署和管理将更加困难。
我有很多这个问题的一半答案,但不是真正的自上而下的解决方案...
我的意思是自上而下:
编辑设置(管理屏幕) 在哪里坚持设置 加载设置,没有太多麻烦,但仍然以可维护的方式 维护/部署客户特定设置所以迄今为止的选择:
(网页)的.config .settings文件 D B但是,这些都是关键价值方法......还有其他建议吗?
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 settingsSo options so far:
(web).config .settings files DBBut these are all kind of key-value approaches... Any other suggestions?
最满意答案
您可以编写一个自定义配置部分 ,它允许您在配置文件中存储比键/值更多的设置。 这就是说配置文件是为只读设置而设计的。 如果您需要使用管理员屏幕编辑功能,那么最好使用数据库。 将这些信息存储在文件中也是可能的,但由于这是一个多线程应用程序,因此您需要正确地同步访问这些可能很快变得繁琐的文件。
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.
更多推荐
发布评论