How To Create An Anti-corruption Layer
This is a work in progress from The Pipeline. It will likely change before it is published to the main listing of articles. It is currently at the "outlined" stage.
- Intro (see previous article about why this is important)
- Steps:
- Find all the code that uses the external service and put it under a new module/class
- Narrow the interface (refactor)
- Move initialisation/configuration into a constructor
- Write integrated tests for the adapter (VCR, etc.)
- Write a mock adapter, and make it pass the integrated tests
- Create the adapter at boot time, in a per-environment way
- Improve any existing tests using the mock adapter
- Summary
Got questions? Comments? Milk?
Shoot an email to [email protected] or hit me up on Twitter (@tom_dalling).