Ways to protect my application from external API changes

I'm wondering about some templates or patterns regarding how to protect my application from changes in external APIs, for example, inside of MS Azure or any other company's API. What is the best way to do it and minimize changes in my code?

Answers


You need to essentially make your own API within your program. Partition the external API consumption with the use of interfaces, so if the external API changes, you can edit the implementation only, as the interface contracts will hold the rest of the program together.


Need Your Help

JavaScript, Generate a Random Number that is 9 numbers in length

javascript

I'm looking for an efficient, elegant way to generate a JavaScript variable that is 9 digits in length:

Scheduling Tasks for Multiple Rails Apps Without Loading Multiple Environments

ruby-on-rails scheduled-tasks

On our servers we have deployed multiple Rails applications using Phusion Passenger. Each application has a set of tasks that must be scheduled and run periodically (the usual clear caches, send ma...