There are three ways in which the configuration metadata is provided to the Spring container, enumerated as follows:
Annotation-based Configuration – By default, annotation wiring is turned off in the Spring container. Using annotations on the applicable class, field, or method declaration allows it to be used as a replacement of using XML for describing a bean wiring.
Java-based Configuration – This is the newest form of configuration metadata in Spring Framework. It has two important components:
@Bean annotation – Same as that of the <bean/> element
@Configuration annotation – Allows defining inter-bean dependencies by simply calling other @Bean methods in the same @Configuration class
XML-based Configuration – The dependencies, as well as the services required by beans, are specified in configuration files that follow the XML format. Typically, these configuration files contain several application-specific configuration options and bean definitions.