Il pattern Adapter consente agli oggetti con interfacce incompatibili di lavorare insieme incapsulando uno con un'interfaccia che l'altro si aspetta. Agisce come traduttore tra due interfacce, consentendo l'integrazione senza modificare il codice esistente.
Cosa fa il pattern Adapter
ADAPTER → convert one interface into another that a client expects (a "translator"):
→ wrap an object whose interface is INCOMPATIBLE, exposing the interface the client needs
→ the adapter translates calls/data between the two interfaces
→ makes incompatible things work together WITHOUT changing either's code
