Typically, applications have a class or "Constants" interface that contains all the constants.
I usually group constants into logical classes. For example, if there can be two types of employees, regular and contractual:
class EmployeeType { public static final String REGULAR = "regular"; public static final String CONTRACT = "contract"; }
and use it as EmployeeType.REGULAR
If the constants cannot be grouped this way, have a separate class / interface for storing them.
class Constants { public static final String APPLICATION_DOMAIN = 'domain'; }
You do not need to extend / implement this class interface in order to use the values. Constants are usually declared public static final , you can access them directly: Constants.APPLICATION_DOMAIN
Nivas
source share