Switching to YAML
Part of the Spring way is options. Developers have varying needs based on circumstances, and Spring tries to offer different ways to effectively get things done.
And sometimes, the number of property settings we need can explode. With the property file’s key/value paradigm, this can get unwieldy. In the previous section, where we had lists and complex values, it became clunky to have to specify index values.
YAML is a more succinct way to represent the same settings. Perhaps an example is in order. Create an application-alternate.yaml
file in the src/main/resources
folder, as shown here:
app: config: header: Greetings from YAML-based settings! intro: Check out this page hosted from YAML users: - username: yaml1 password: password ...