Code on a screen, representing the adapter pattern.

Making incompatible interfaces work together.

What the adapter pattern is

The adapter pattern is a software design pattern that allows objects with incompatible interfaces to work together. It does this by providing a wrapper, called an adapter, that translates the interface of one object into an interface that another object expects. In this way, two pieces of software that were not designed to work together can cooperate, with the adapter bridging the gap between them.

The problem of incompatible interfaces

In software, an interface is the set of methods and expectations through which one piece of code uses another. Sometimes you have a component that does what you need, but its interface does not match what the rest of your code expects. Rewriting either side may be impractical. The adapter pattern solves this by inserting a translator between them, so neither has to change.

How the adapter works

An adapter wraps the object with the incompatible interface and exposes the interface the client expects. When the client calls the adapter, the adapter forwards the request to the wrapped object, translating as needed. From the client's point of view, it is simply using the expected interface; behind the scenes, the adapter is adapting those calls to the other object. This keeps the client code clean.

Why the pattern is useful

The adapter pattern is useful because it lets you reuse existing components that would otherwise not fit. Instead of modifying well-tested code or the client, you add an adapter to reconcile the two. This is especially valuable when integrating third-party or legacy code whose interfaces you cannot change. The adapter localizes the translation in one place, keeping the rest of the system unaffected.

Adapter among design patterns

The adapter is one of the classic design patterns that describe reusable solutions to common design problems. Naming it gives developers a shared vocabulary: saying something is an adapter conveys that it wraps an object to match an expected interface. Recognizing this pattern helps when integrating components that do not naturally fit together.

Why it matters

The adapter pattern is a fundamental design pattern for integration. Understanding what it is - wrapping an object so its interface matches what the client expects - clarifies how incompatible pieces of software are made to cooperate. For anyone learning software design, it is a valuable concept to understand.

See also: What is a design pattern? Explained, What is an interface in programming?.

Sources

Published date reflects the original event date (2026-02-03). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply