Adapter

Problem

An online shop sends order confirmations through an EmailSender.send(to, subject, body) interface. A new email provider's library instead expects deliver(message), with the recipient, subject, and text inside a message object. The shop needs a way to call this provider while keeping its existing email interface.

Solution — Adapter

An EmailAdapter implements EmailSender. The shop calls the adapter's send() method; the adapter builds the provider's message object, calls deliver(message), and translates the result back for the shop.
Shop → EmailAdapter.send(to, subject, body) → Provider library.deliver(message)
Core idea: an adapter translates the interface the caller uses into the interface another component requires.