Performance: @ConfigurationProperties for type-safe config
MEDIUM IMPACT
This affects application startup time and memory usage by how configuration properties are bound and validated.
@ConfigurationProperties(prefix = "app") public class AppConfig { private int timeout; private String name; // getters and setters }
@Value("${app.timeout}") private int timeout; @Value("${app.name}") private String appName;
| Pattern | Property Lookups | Type Conversions | Startup Time Impact | Verdict |
|---|---|---|---|---|
| Multiple @Value annotations | Multiple (one per property) | Multiple (one per property) | Higher startup time due to repeated work | [X] Bad |
| Single @ConfigurationProperties class | Single batch lookup | Single batch conversion | Lower startup time with efficient binding | [OK] Good |