Skip to content
BENIBIX Learn

Adapter Pattern vs Facade Pattern

People think an adapter and a facade are the same wrapper. An adapter wraps one thing so it fits a shape another part expects. It changes the interface, but not how much there is to it. A facade puts one simple front over many parts. It makes the interface smaller, so callers have less to learn. You use an adapter to make things fit, and a facade to make them easy.

Development🏗️ Architecture

Adapter Pattern

A wrapper that lets one piece of code fit another.

The adapter pattern wraps one piece of code so it looks like another. It is used when two parts should work together but expect different shapes. The adapter sits in between and turns each call into the form the other side needs. Neither side has to change. It is common when you plug in an outside library or an old system.

Example
Jack's app expects a send method. The new text library has a postText method. A small adapter class turns one into the other.
Why it matters
It lets you use outside code without letting its shape spread through your whole app.
Full entry
Development🏗️ Architecture

Facade Pattern

One simple front for many parts. Callers need just one call.

The facade pattern puts one simple interface in front of a group of complex parts. Callers use a few easy methods on the facade. The facade then calls the many classes behind it in the right order. The parts behind it still exist and can be used directly if needed. It hides detail, but it does not change what the parts do.

Example
Emma's shop has an order facade with one method, place(). Behind it, place() checks stock, takes payment and books the delivery.
Why it matters
Most code needs only the common path. A facade keeps that code short and keeps the messy parts in one place.
Full entry

In one line

Adapter Pattern
A wrapper that lets one piece of code fit another.
Facade Pattern
One simple front for many parts. Callers need just one call.