Dev.to
7/23/2026

Adapter: The Travel Plug Pattern
Short summary
The Adapter design pattern is explained through a travel plug analogy: just as a plug adapter translates between incompatible socket shapes without modifying either side, a software adapter translates between incompatible interfaces. The article demonstrates a C# implementation where a ThirdPartySmsClient with a PushSms method is adapted to fit an INotificationSender interface expecting a Send method. Key takeaway: adapters quarantine external dependencies behind your own interface, making vendor swaps trivial.
- •Adapter pattern translates between incompatible interfaces without modifying either side
- •C# example adapts a third-party SMS client to match a custom notification interface
- •Real payoff: swapping vendors becomes writing one new adapter instead of rewriting app code
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



