API Facade Common Patterns: For internal & external systems
In the Webinar and blog posts about the API Facade pattern, we've talked about API facades that make it easy to provide access to internal systems, and a lot of companies use a facade in this mode.
Another use of the same pattern is to easily consume APIs from external systems.
All of the same issues and considerations come into play with internal and external systems. We've seen a number of cases in which core businesses rely on external services. We've also seen cases where those service providers change their pricing models and with that the business that is tied to the service provider can see its profit margins shrink, it's SLAs deteriorate, or other business relationship change. A facade pattern can help mitigate risk in cases like this.
With a facade pattern in place, apps that consume the external services can expect a canonical model to consume the APIs. Also, if implemented through the facade, the external services can easily be plugged and replaced.
All of the same approaches to implementing common patterns come into play for the external scenario - starting with building out the errors facade and the data stubs - and you've created your canonical model of service consumption.