Easy
The following code
public interface AddressResolver{...}
@Component
public class GoogleMapAddressResolver implements AddressResolver{
//...
}
@Component
public class CustomMapAddressResolver implements AddressResolver{
//...
}
@Service
public class AddressService{
@Autowired
private AddressResolver addressResolver;
//...
}
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
16
Explain the prototype scope in Spring7
Explain the `session` scope in Spring4
What is the scope of a bean with a `request` scope?5
How is PDO implemented in Spring?4
The `@Autowired` annotation is a Spring annotation, accepts a parameter allowing to specify if a dependency is optional4
How does Spring match beans?13
A bean with a `session` scope is injected into a bean with a` singleton` scope. What happens when the application starts?