Adapter Design Pattern Explained
Adapter converts the interface of one class into another interface that calling code expects, letting otherwise incompatible interfaces work together.
Published November 12, 2026
Adapter converts the interface of one class into another interface that calling code expects, letting otherwise incompatible interfaces work together.
Why it exists
- Integrating a third-party library or legacy code whose interface doesn't match what the rest of your application expects
How to apply it
- Create a wrapper class that implements the interface your code expects, internally translating calls to the underlying incompatible class
- This isolates the incompatibility to one place instead of scattering conversion logic throughout the codebase
FAQ
Is an adapter the same as a wrapper?
An adapter is a specific kind of wrapper whose purpose is translating one interface into another — "wrapper" is the more general term.