class

Profile

extends PropertySource

All supertypes

Collection of named things. The purpose of profiles to have a single component configuration for multiple environments where the component might be deployed. For example a single component configuration can be used on a local developer workstation, in a shared development environment, testing environment and production environment. In each deployment the client code supplies a different profile path, but the component configuration resource remains the same. It alleviates an often encountered problem when different environments have different configuration resources and as such problems in production environment can not be reproduced in development environment. An often used approach with substitution variables (tokens) quickly goes out of control as complexity of the system increases. Profiles can leverage substitution variables and provide additional level of flexibility. Profiles form a hierarchy (path). Named values on lower levels shadow/override values defined at higher levels. For example, let's say there is a data source definition. It has driver class, url, user and password. The driver class name (and a path to load the driver) can be defined at the root level, as well as the database user name. Connection URL can be defined at the environment profile level - different URL's for local environment, DEV and PROD. The password shall not be stored in the config file. So it shall come from a substitution token, e.g. $[db.password]. The password can be defined at the root level, or at environment level. In the latter case the token may contain environment name, e.g. $[db.password.DEV]. If, acciedentally, developer tries to load production profile in his local or DEV environment, then startup will fail because of unsuccessful expansion of $[db.password.PROD] token or because substituted password will be invalid. The first case - unsuccessfull expansion is easier to detect and troubleshoot. Profiles also allow to specify different qualities of service (e.g. performance, cost, distributes vs. local computation) for the same component with the same interface in different environments.

Attributes

Name Type Cardinality Description
description EString 0..1 Profile description.
name EString 1 Profile name.

References

Name Target Containment Cardinality Opposite Description
owner PropertySource 0..1 profile Parent profile or object definition.