I am working on an API for several web services, which all return a list of products. However, the objects returned are quite different. They have some overlap in member variables and methods, but also a number that are either conceptually different or slightly different. What would be the best way to structure the API? I think this is the adapter pattern, but I am not sure.
So e.g. my class has (pseudocode, not a real language)
member: webservice (type:object, can be a number of types, all adhering to the same interface)
method: setCurrentWebservice(service) {self.webservice=service}
method: getProducts() { return self.webservice.getProducts();}
Also some methods are supported in one webservice, but not in the other. Should I make 'method-not-supported' methods? What should those return?