robfletcher
05/02/2019, 12:12 AMdmcg
05/02/2019, 7:56 AMchristophsturm
05/02/2019, 8:55 AMrobfletcher
05/02/2019, 5:07 PM@Bean
methods rather than just using @Component
annotationschristophsturm
05/06/2019, 2:14 PMrobfletcher
05/06/2019, 5:14 PM@Component
and collaborators will get auto-wired or you can use an configuration class with a method annotated @Bean
that explicitly registers the component. Usually you do the latter if you need the component to be conditional or have a non-trivial auto-wiring case, e.g. in this case you want to pass a single method of another bean as a function param to the component’s constructor rather than wiring in the entire other bean.@Component
you can save the effort of writing a factory method in a special configuration class.christophsturm
05/07/2019, 8:30 AMrobfletcher
05/07/2019, 6:15 PMchristophsturm
05/08/2019, 12:40 PMrobfletcher
05/08/2019, 3:31 PM