What Are Ports and Adapters?
In the ports and adapters pattern, a port is an interface the application core declares to express what it needs or offers, and an adapter is a concrete implementation that connects that port to a real system. Inbound adapters drive the application, while outbound adapters let it reach databases or services. The core depends only on ports, never on adapters.
Why it matters
This separation lets you test the core against fake adapters and switch real ones without rewriting logic. It is the structural mechanism behind hexagonal architecture.
Related guides
What Is Hexagonal Architecture?Hexagonal architecture isolates core application logic from external concerns through ports, with adapters co…
What Is Dependency Inversion?Dependency inversion is the principle that high-level modules and low-level details should both depend on abs…
What Is an Anti-Corruption Layer?An anti-corruption layer translates between your domain model and an external or legacy system so foreign con…