#adapter

Software Design Patterns (Adapter)

Published at July 25, 2020 ·  3 min read

In this fifth part of the Software Design Patterns blog series I’ll talk about a pattern that probably most of us have heard of or even used before but that we haven’t had the opportunity to build, I’m talking about the Adapter Pattern. The Adapter pattern acts as a bridge between two incompatible classes by “adapting” the functionality of one class into the other via an interface. One of the most popular examples of the Adapter Pattern is how different programming languages uses Adapter classes to access a database, it’s very common to se MySqlDataAdapter, PgSqlDataAdapter, etc, what these adapters are doing is creating a bridge or “adapting” into the specificities of each database engine so you don’t have to worry about those minor details or worse having to create your own adapters....