Loading...
The Adapter pattern (GoF, 1994) applied to external dependencies: create an internal interface (PaymentProcessor, EmailSender) and implement it with an adapter per vendor (StripeAdapter, SendGridAdapter). Business logic references the interface, never the SDK directly. This enables vendor switching with one line change and enables MockAdapter for deterministic unit tests.
Sign in to join the conversation.