ArjanCodes
25 minutes
Ports and adapters (hexagonal architecture) is a software architecture that separates a system into a framework-free domain core, domain-owned interface definitions called ports, and infrastructure-specific adapters, with all dependencies pointing inward toward the domain. Its purpose is to keep business rules, invariants, and domain language independent of transport, persistence, and framework concerns, so the domain can be tested in isolation and infrastructure can be replaced without rewriting business logic. It belongs to software design and architecture, applying the dependency inversion principle and separation of concerns to application structure.