开发者

Should I use the app.config or custom xml file for data init in my project when I have N items to init?

I'm writing a multi threaded win service that on load should read a list of N queue name开发者_开发问答s and than init a queue reader class for each queue name.

What would be the right way to go ? to hold a list.xml file with all the queue names (and 3-4 more values per queue name) or put custom data in the app.config for this (which will require me to implement ConfigurationElementCollection / ConfigurationElement in my application (longer way to go).

Thx.


I'd use the config - it's exactly for this purpose. I have seen configs that are hundreds of lines long.


If the list is to change during run time, I would use separate xml file otherwise app.config. this way I could drop a new file every time I need to without worrying about messing up app.config.

In your case you say it is done only during startup, then app.config is better.

But all depends on personal choice and how it fits into the whole architecture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜