Ports & Adapters Architecture Flashcards
What is the goal of this architecture?
Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.
What is the main idea of the Hexagonal Architecture?
The idea is to think about our application as the central artefact of a system, where all input and output reaches/leaves the application through a port that isolates the application from external tools, technologies and delivery mechanisms.
What is a Port?
A port is a consumer agnostic entry and exit point to/from the application. In many languages, it will be an interface.
What is an Adapter?
An adapter is a class that transforms (adapts) an interface into another.
What are the benefits of this approach?
Using this port/adapter design, with our application in the centre of the system, allows us to keep the application isolated from the implementation details like ephemeral technologies, tools and delivery mechanisms, making it easier and faster to test and to create a reusable proof of concept.