"value":"\n <p>You need to add an integration with a new service or supplier to your application code.<\/p>\n\n<p>You should avoid writing code that interacts directly with that service or supplier - a.k.a tightly-coupled code.<\/p>\n\n<p>What if you change to a different service or supplier in the future?<\/p>\n\n<p>What if they release a new version of their API that includes breaking changes?<\/p>\n\n<p>If your code is tightly coupled to a single implementation, you'd need to rewrite the code, and there wouldn't be a way to easily switch from the old version to the new one.<\/p>\n\n<p>By introducing an adapter layer, you make your code more loosely coupled.<\/p>\n\n<p>You can have multiple implementations, with one for each different supplier, service, or version.<\/p>\n\n<p>You can have a consistent interface and API for every implementation, making them hot-swappable and making it easy to switch between different implementations.<\/p>\n\n<p>If you change supplier or they release a new version, you write a new implementation for it and switch when you're ready.<\/p>\n\n<p>Also, as every implementation satisfies a common interface, it's easy to make a fake implementation that you can use for testing.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>You need to add an integration with a new service or supplier to your application code.<\/p>\n\n<p>You should avoid writing code that interacts directly with that service or supplier - a.k.a tightly-coupled code.<\/p>\n\n<p>What if you change to a different service or supplier in the future?<\/p>\n\n<p>What if they release a new version of their API that includes breaking changes?<\/p>\n\n<p>If your code is tightly coupled to a single implementation, you'd need to rewrite the code, and there wouldn't be a way to easily switch from the old version to the new one.<\/p>\n\n<p>By introducing an adapter layer, you make your code more loosely coupled.<\/p>\n\n<p>You can have multiple implementations, with one for each different supplier, service, or version.<\/p>\n\n<p>You can have a consistent interface and API for every implementation, making them hot-swappable and making it easy to switch between different implementations.<\/p>\n\n<p>If you change supplier or they release a new version, you write a new implementation for it and switch when you're ready.<\/p>\n\n<p>Also, as every implementation satisfies a common interface, it's easy to make a fake implementation that you can use for testing.<\/p>\n\n ",