Java Configuration & @Bean
Learn Java Configuration & @Bean (Spring Framework Fundamentals, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
A Class That Replaces an XML File @Configuration marks a class as a source of bean definitions. It is the Java equivalent of a spring.xml file - same job, checked by the compiler. It arrived in Spring 3.0 (2009) and is now the default way to configure everything. XML still works and you will meet it in older projects, but nothing new is written that way.