http://docs.spring.io/spring/docs/3.1.x/javadoc-api/org/springframework/context/annotation/Configuration.html
public @interface ConfigurationIndicates that a class declares one or more @
Bean methods and may be processed
by the Spring container to generate bean definitions and service requests for those
beans at runtime, for example:
@Configuration
public class AppConfig {
@Bean
public MyBean myBean() {
// instantiate, configure and return bean ...
}
}
<beans>
<context:annotation-config/>
<bean class="com.acme.AppConfig"/>
</beans>
vs
@Configuration
@ComponentScan("com.acme.app.services")
public class AppConfig {
// various @Bean definitions ...
}