Hey guys,
I'm looking for some thoughts on which design pattern(s) to use for my problem, regardless of language.
I am accessing three APIs that have different interfaces and functionality, but are all for the same purpose, returning information to me, in a uniform way, about the same kind of content -- blog authors.
Some APIs do exactly what I want, some will require API + Screen Scraping, and so on.
The obvious choice seems to be Adapter pattern but I want to really dig into the design of this thing and as such your thoughts would be greatly appreciated!
To be totally clear, right now I envision one class per web service that both does the basic API stuff as well as the less elegant stuff. I imagine it then returns uniform results to its Adapter. I imagine the Adapter takes a method like Search and then routes it to the appropriate method in the API, and gets back the results, which will look the same regardless of which service was called.
If this sounds like a homework assignment, it is -- but it's one I've assigned to myself in order to learn some cool design pattern stuff. Is Adapter right? Any other good options?
Thanks in advance!
UPDATE: While Adapter and Facade patterns seem to me to share a lot of similarities, Paweł Dyda points out below that what I'm describing is really Facade rather than Adapter. I agree. Does anyone think that there is a better option than Facade, assuming a growing number of APIs over time?
Thanks again.