🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Adapter

In plain terms

A pattern that lets incompatible interfaces work together.

Going deeper

An adapter wraps one interface to look like another the client expects, enabling reuse of existing code without changing it. It's the glue between mismatched components.

Under the hood

Wraps an existing interface to match what a client expects; object adapters use composition, class adapters use inheritance. Eases integrating legacy or third-party code.

Examples

Wrapping a legacy API, power-plug adapters, type-A to type-B interface bridges.

Think of it like...

Like a travel plug adapter: it lets your charger fit a foreign socket without rewiring the charger or the wall.

Feedback & Bug Report