VMware vRealize Automation 8.x (2022) — Question 62
Which two statements are correct regarding the differences between @ConfigurationProperties and @Value? (Choose two.)
Answer options
- A. @Value must be used for environment variables, as @ConfigurationProperties cannot access the environment.
- B. @Value supports relaxed binding of properties, but not property binding through SpEL.
- C. @ConfigurationProperties is preferable over @Value when type-safety during property binding is a concern.
- D. @ConfigurationProperties only bind properties from .properties files, not from .yml files.
- E. @ConfigurationProperties supports relaxed binding of properties, but not property binding through SpEL.
Correct answer: C, E
Explanation
@ConfigurationProperties is indeed preferred when type-safety is important, which is why option C is correct. Option E is also accurate as @ConfigurationProperties does enable relaxed binding but does not support SpEL. The other options contain inaccuracies regarding the capabilities of @Value and @ConfigurationProperties.