I'm trying to understand the transition from using xml annotation to java based annotation in Spring. I have these definitions
<context:annotation-config>: Scanning and activating annotations for already registered beans in spring config xml.
<context:component-scan>: Bean registration + <context:annotation-config>
is @Configuration and is @ComponentScan.
If lets say I declare all my beans with @Component (disregard first the more specific ones like @Repository, @Service etc) annotation and make sure that the packages are getting scanned by the @ComponentScan annotation, what is a particular use case where I will still annotate my class with both @Configuration together with @ComponentScan?
I ask this question because sometimes I see classes annotated with both @Configuration and @ComponentScan at the same time.