Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 746 Bytes

File metadata and controls

20 lines (15 loc) · 746 Bytes

Overview

  • Why JavaConfig and not XML for configuration

Why JavaConfig? (not xml)

  • 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

More info