Your support for multiple environments is good. As a suggestion for an
optional change / improvement, how about the following? In addition to
defining each of the environment specific properties in separate files and
the generic/default values in yet another file, could all of these
properties be defined in a single file?
Continuing with your examples of "skin", I am suggesting a single
"my-app.properties" file such as the following:
skin.development=blue
skin.test=yellow
skin=red
your code would simply call the following:
String skin = getProperties().getString("skin");
The benefit of this approach is that all the values are stored together,
making it easy to see the values at a glance, as well as to ensure that
values have been defined for all the props (which is especially handy when
adding new props).
Yes, one potential negative drawback of this approach is that all the
information will be stored in a single file, which some users might have an
issue with if there is sensitive data (but then I would suggest that the
sensitive properties are less frequent and can be handled by the inclusion
of another file).
How would EasyConf know which environment the application is running in?
Via a "environment marker" as you describe on the multi-environment
documentation page.
Nobody/Anonymous
Core functionality
None
Public
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use