I have many classes with static final fields which are used as default values or config. What is best approach to create global config file? Should I move these fields to single static class, use properties file or what?
Edit: I need to use this values both in java classes and xhtml pages. Values dosen’t depend on envirnoment. I could compile project to set new values – no problem.
The answer depends…
enumtostatic finalconstants where possible (avoid “stringly typed” code)TimeUnitto convert hours to seconds, rather than havingstatic final int SECONDS_IN_HOUR = 3600;)public static finalin the class that has “most ownership” over them