Card 07/ 07
All 7 cards
RecapDifficulty: Advanced1 min
What This Topic Established
Constructor injection is the default, because a class wired this way cannot exist half-built, and its dependency list is visible in one place. @Autowired on a constructor is only required when a class has more than one.
@Component, @Service, @Repository and @Controller all register a bean the same way; they differ in what they signal, and @Repository alone also translates exceptions.
Two beans of one interface type is a startup failure, not a runtime guess — fixed with @Primary for a default, @Qualifier for a specific caller's choice. A class you don't own is wired with a @Bean method instead of an annotation you can't add.