- Why JavaConfig and not XML for configuration
- Java compiler enforces typesafey for JavaConfig (XML is not typesafe)
- XML is more verbose than Java
- JavaConfig allows init logic (XML does not)
- JavaConfig allows preconditions (XML does not)
- JavaConfig is refactor friendly
- (unlike XML) JavaConfig files are already on the classpath
- (unlike XML) JavaConfig files don't need to be parsed at startup
- Spring recommends JavaConfig
- Modern versions of documentation use that
- Spring Initializr generates JavaConfig