EnvironmentConfig (EC) aims to solve a problem developers face when using multiple tiers in the development LifeCycle. That is that each server/environment may have properties that do not match the other servers. For instance, in a three tier development setup (development, staging and production) you may find that the data-source names (DSN’s), Mail Server address and credentials, path to certain folders, etc. differ from server to server. On each deployment or every time a patch is applied, the developer must ensure those variable properties are correct or else the application will break. Ensuring each environment contains the right values for each property may become a tedious process, especially if the application evolves constantly.
EnvironmentConfig address this issue by allowing the developers define each environment and properties in an XML file once. This file is processed when the application starts and EC will automatically Detect the environment the application is running at, based on the domain name. The environment’s specific properties are loaded and available to the developer for use in a several ways depending on configuration set.
You can use the properties returned by EC as a structure of properties (normal or flattened) or with a Config Bean that EC can create for you on the fly.