Ali*_*Ali 4 c# architecture asp.net coding-style c#-4.0
我有一些全局设置例如以下是一些
ShortLeaveAllowedInOneDay = 2
LeaveAllowedInMonth = 3
Run Code Online (Sandbox Code Playgroud)
我有以下选项来存储这些全局设置
1-Store in Database table
2-Store in Webconfig file
3-Store in class as const filed
4-In XML file
能否请您建议哪一个更好的方法和原因
我正在使用Asp.net MVC3和sqlserver 2005
这取决于您的要求,这些选项中的每一个都有自己的优点和缺点.它试图列出一些:
1.存储在数据库表中
优点:
缺点:
2.存储在web.config文件中
优点:
缺点:
web.config可能会导致应用程序池重新启动.
3.作为const字段存储在类中
优点:
缺点:
4.在XML文件中的
优点:
log4net一个这样的例子)缺点:
| 归档时间: |
|
| 查看次数: |
5530 次 |
| 最近记录: |