How To Create An Anti-corruption Layer

??? words · ??? min read

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:
    1. Find all the code that uses the external service and put it under a new module/class
    2. Narrow the interface (refactor)
    3. Move initialisation/configuration into a constructor
    4. Write integrated tests for the adapter (VCR, etc.)
    5. Write a mock adapter, and make it pass the integrated tests
    6. Create the adapter at boot time, in a per-environment way
    7. 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).

← Previously: Backlog

Next up: My Post →

Join The Pigeonhole

Don't miss the next post! Subscribe to Ruby Pigeon mailing list and get the next post sent straight to your inbox.