views:

34

answers:

1

I have few settings which I could place in a separate XML file and have them accessed in the Web app. Then I thought (thinking of one additional file to deploy), why not have them in the web.config itself. However, just because I need to have custom nodes, I can not have the settings under . So, I am thinking of creating a custom config handler following this. Would that be better than having a separate XML file? Is It going to be an overkill or performance wise? Is there a better way to go?

+4  A: 

From performance standpoint putting custom settings in web.config and creating a configuration handler will be OK because the config values are cached and read only once when the application starts. Putting the values in a separate XML file you will need to handle the caching your self if you want to avoid parsing it every time you need to access those values.

Darin Dimitrov
One more benefit of keeping everything in web.config is that future developers will probably be more comfertable with it, since its likely a system they will have previous experience with.
Nate Bross
+1 I would absolutely agree.
ydobonmai
Darin, what would be the difference If the application is a Windows service and If I have those settings in the App.config or the custom config handler? For me, the additional file problem remains.
ydobonmai
The configuration system works the same no matter the type of application.
Darin Dimitrov