by deterministic · 3y ago · 0 comments
If you can’t avoid some dependencies then put a firewall between your code and those dependencies. The firewall shields your code from changes to the dependencies.
Basically:
Your code -> Interface -> Adapter -> 3rd party dependency.
So your code depends on the interface not the 3rd party code. And the adapter implements your interface by mapping it to the 3rd party dependency.
No comments yet.