Anonymous
Unregistered
|
Multi-user, multi-properties
04/08/06 08:29 AM
|
|
|
I prefer to read properties from a source defined outside the program:
java -DMY_APP_CONFIG=~/.myapprc
This way different users can have different config-files. Even one user may have different ones.
This way the user may put his configurationfile to a place which is part of a backup. And don't has to unjar the jar, which is discussed above.
Another search-strategie which is well established looks like this: - is there an explicit configuration-file given? (-DMY_APP_CONFIG=~/.myapp-tiny-rc) - if not, is a configuration-file found at the users default-place (linux: ~/.myapprc) - if not, is a system-wide config file available (/etc/myapprc) - if not, use build-in defaults.
This way, configuration is simple, but fine granulated control solutions are possible.
|
|