from: http://stackoverflow.com/questions/10604298/spring-component-versus-bean http://stackoverflow.com/questions/27091553/are-bean-and-component-annotations-the-same-but-for-different-targets-in-sprin @Component and @Bean do two quite different thin…
@Component and @Bean do two quite different things, and shouldn't be confused. @Component (and @Service and @Repository) are used to auto-detect and auto-configure beans using classpath scanning. There's an implicit one-to-one mapping between the ann…
@Component auto detects and configures the beans using classpath scanning whereas @Bean explicitly declares a single bean, rather than letting Spring do it automatically. @Component does not decouple the declaration of the bean from the class definit…