tags:

views:

97

answers:

2

What is the best practice to store constant values that hardly will ever be changed during application life-cycle?

For example there are constant messages to show on UI (and you know exactly application will never be localized) or category-ids that are hard-coded in the database.

It takes too much time to put everything in config. Is it normal to have static constant classes to keep such constants all together? Or may be you should put such values into project resources?

Thank you in advance!

+1  A: 

and you know exactly application will never be localized

You might think you know that the you will never have to worry about multilanguage but ... (requirements change so easy these days).

So just to be on the safe side put every GUI string in the a/the resources file. With .net making it so easy to localize strings and because it takes so little effort to put the strings in the resourse file it is not worth not doing it.

Ando
A: 

The classic .NET solution to this is to use resource files. Apart from keeping all your code together, this has the added benefit of readying your application for localization.

Oded