Default values: hard-code, or .config file?

You might even consider going one step further and storing your defaults in the database. This will provide flexibility of configuration and centralized management of those defaults Personally, the approach I might often take is to have my configuration in code, but have the ability to override the defaults by supplying new values in the configuration file or in the Db. Why do I go this far?

Well this way I can deploy with minimal configuration and then provide overrides if and when required.

You might even consider going one step further and storing your defaults in the database. This will provide flexibility of configuration and centralized management of those defaults. Personally, the approach I might often take is to have my configuration in code, but have the ability to override the defaults by supplying new values in the configuration file or in the Db.

Why do I go this far? Well this way I can deploy with minimal configuration and then provide overrides if and when required.

I like your thoroughness – ErOx Oct 7 at 15:55.

Since there is no way that you know what these values should be at deployment time, you should have them in configuration. You may find it inelegant, but with values that may need to change without code changes, this is the only option. Unless you know that deployment is fast and easy and that any code changes can be deployed quickly and without error.

You could also store them in the database where the issue tracking data is stored.

In this context, database == configuration. And you don't know that using a database is even a possibility. – Oded Oct 7 at 15:49 Not a bad suggestion, however having to document the addition of new stored procedures, DTOs, business logic, etc., and then implement these things is going to affect my strict deadline.

Otherwise, I would strongly consider this. – ErOx Oct 7 at 15:49.

First, hard-code reasonable defaults to maintain resiliency. No one likes a program which is made useless by the absence of not so strictly necessary text file. Second, a config file is not at all an inelegant way to handle custom configuration.

Depending on the environment you're deploying to, providing a gui config tool is another option. I.e. Are end users going to be changing configs on thy fly?

Or are sys admins going to be making planned changes?

1 for the mention of "defaults". I have hard-coded defaults, in my DTOs. The Data Contracts exposed over the WCF service are even more simplified than the DTOs, and these configuration details aren't even exposed on the other end of the WCF service.It is my responsibility, not the website groups', to broker the details of where these issues land in the admin console.

– ErOx Oct 7 at 15:54.

I think a third option which you have not listed is to have them in a Database. There are various caching strategies you can employ to address performance concerns. The benefit of this approach is that you could host your application on one or more servers and not have it be a pain to update config changes for them.In my experience, this has been the best approach for these cases.

I can easily see the benefit of caching here. Very good point, although I'm under a strict time constraint, and likely won't have time to implement something like this. – ErOx Oct 7 at 16:39.

Putting them in the configuration is probably the best choice. If you're looking to have a nice way to access them you can create a static class that acts as an accessor or use something like dependency injection. Example accessor class: public static class DefaultSupportValues { public static string ProjectID { get { return ConfigurationManager.

AppSettings"DefaultProjectId"; } } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions