Adapter Pattern
Medium — good to knowArchitecture
ELI5 — The Vibe Check
You're in Europe with a US charger. You need an adapter. In code, your app expects a PaymentProcessor with a .pay() method, but the new Stripe SDK uses .processPayment(). An Adapter wraps Stripe and translates .pay() calls into .processPayment() calls. Your app never knows Stripe's interface even exists.
Real Talk
undefined
When You'll Hear This
undefined
Related Terms
Decorator Pattern
You have a Coffee object. You want Coffee with Milk. Coffee with Sugar. Coffee with Milk and Sugar. With inheritance you'd need four classes.
intermediateArchitecture
Proxy Pattern
A Proxy is a stand-in for a real object that controls access to it.
intermediateArchitecture
Strategy Pattern
You're writing a sorter and want to sort by price, name, or date depending on user choice.
intermediateArchitecture