views:

44

answers:

1

What pattern(s) would be good to manage multiple API's?

A scenario for using multiple API's would be a payment portal that allows clients to use different payment vendors to post transactions. So this system may need to utilize a papypal, fasttransact, x, y, or z API.

+2  A: 

You'll want a unique Facade interface of your design, bridging your calls to each of these different payment vendors' systems; the concrete realizations of that Facade will likely be implemented, of course, by what amounts to a collection of Adapters -- and the appropriate one for a given transaction can be chosen by some appropriate Factory (method or otherwise;-).

Alex Martelli