DZone

Main Points:

  • Property files allow the centralization of properties.
  • Property placeholders used instead of hard coding.
  • Property file location must be configured in global elements.
  • Property files can be constructed in Java or YAML format.

Centralization of Application Properties

It is best practice to centralize the management of properties rather than hard code values at the location of use. This allows for the reuse of values and better maintenance. Instead of changing the property in multiple places (if the value has been hardcoded), you change the value once in the property file and every location where that property placeholder is used gets to use the new value at runtime.

Setting up A Property File

There are three parts to set up when you want to use property files:

Source: DZone