Adapter — A design pattern for having the interface you want from what you have

Explanation, use cases and detailed C++ source code

Fabrizio Di Guardo
Level Up Coding
Published in
4 min readJan 4, 2024

--

Photo by Call Me Fred on Unsplash

You often need to change your code based on an interface received from an external source. In these cases, the best solution is to build an Adapter:
a construct that adapts an existing interface X to conform to another one Y.

--

--

A Computer Science engineer with a passion for new technologies. Happy to live in one of the most revolutionary moments in the history of mankind.