Skip to main content

Adapter Pattern2026-05-13

The Adapter Pattern is a structural design pattern that allows two incompatible interfaces to work together.

In this weather dashboard example, the client expects weather data in Celsius and kilometers per hour through a standard interface. The third-party service returns raw values in Fahrenheit and miles per hour.

The adapter sits between them, translates the legacy values into the format the client expects, and keeps the rest of the app decoupled from the external API.

Full Implementation

See Weather App LLD for the complete code implementation.