Understanding adapters
In hexagonal architecture, adapters have a different role than the adapters described in Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. In the Gang of Four (GoF) design patterns, we use adapters to make the interfaces of two diverging classes compatible with each other. In the hexagonal architecture, we use adapters to allow a system to be compatible with different technologies or protocols. Although the adapter's role in those two approaches may differ, it would be correct to state that both approaches share the same purpose, that is, to adapt something to fit correctly into another thing.
A practical analogy to understand the role adapters play in hexagonal architecture is about remote connections to a computer. Every modern operating system is compatible with remote connection protocols. In the past and even today, in certain situations, it was common to use Telnet to...