Understanding adapters
In hexagonal architecture, adapters have a different role from those employed as a design pattern in object-oriented languages. As a design pattern, we use adapters to make the interfaces of two diverging classes compatible. In the hexagonal architecture, we use adapters to allow a system to be compatible with different technologies or protocols. Although the adapter’s role as a hexagonal architecture concept or as a design pattern may differ, it would be correct to state that both approaches share the same purpose: 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 open a remote connection to a computer. Over time, other protocols emerged, such as SSH for console...