This code is just a simple idea which takes a query parameter and requests n
number of third party services for the given query:
public class SearchInteractor {
private List<Service> services;
private String query;
private List<String> result;
public SearchInteractor(String query, List<Service> services) {
this.query = query;
this.services = services;
}
public String[] search() {
result = new ArrayList<String>;
for (Service service: services) {
result.add(service.search(query));
}
}
}
I am thinking of injecting a query and services in the search method. What do you think?