Archived
The following code
public class interface AddressResolver{...}
@Component
public class GoogleMapAddressResolver implements AddressResolver{
//...
}
@Component
public class CustomMapAddressResolver implements AddressResolver{
//...
}
@Service
public class AddressService{
@Autowired
private AddressResolver addressResolver;
//...
}
Similar QuestionsMore questions about Spring
15
Explain the prototype scope in Spring12
A bean with a `session` scope is injected into a bean with a` singleton` scope. What happens when the application starts?5
Explain the `session` scope in Spring4
How does Spring match beans?4
The `@Autowired` annotation is a Spring annotation, accepts a parameter allowing to specify if a dependency is optional