An adapter places an application-facing interface over a third-party library, translating external complexity into the project’s domain language. It acts as an anti-corruption layer and limits exposure to features the application actually needs. section 9.2
Use adapters to improve maintainability and testing:
- Mock the adapter your team owns rather than the underlying third-party type. section 9.2
- Expose only required library behavior, reducing coupling and limiting upgrade-related ripple effects. section 9.2
- Keep interaction verification at controller boundaries when testing unmanaged dependencies. section 9.3
Message bus wrapper
A CRM application can define its own IBus interface over a message-bus library. Tests mock IBus instead of guessing how the external interface behaves; production code remains insulated from library changes. section 9.2








