Spring service implementation by environment property
问题 I have a service interface interface ImageSearchService { // methods... } And I have 2 implementations: @Service class GoogleImageSearchImpl implements ImageSearchService { // methods... } @Service class AzureImageSearchImpl implements ImageSearchService { // methods... } And I have a controller to use one of the both: @Controller ImageSearchController { @Autowired ImageSearchService imageSearch; // Google or Azure ?!? } How can I use a Environment API to set the right one implementation? If