Skip to content
← Back to Glossary

Ports and Adapters

architecture hexagonal ddd functional

An architecture where the domain core defines abstract boundaries (ports) and all external dependencies plug in through concrete implementations (adapters), also known as Hexagonal Architecture.

↑ Contents

Definition

In Ports and Adapters, the domain core is pure — data in, data out, no I/O. A port is the boundary where certainty ends and uncertainty begins: filesystem, HTTP, database, time. Adapters implement ports with real infrastructure. The domain never imports an adapter; the adapter always imports the domain. This dependency direction is the constraint that matters most — when it holds, the domain is testable without mocks and portable across infrastructure. Enforcement is the hard part: tools like eslint-plugin-boundaries and clj-depend can check it mechanically.

↑ Contents

Source

↑ Contents