ports and adapters
compound.compound. a way of designing software so the main logic is kept separate from outside tools like databases or websites. This makes it easier to test the code and swap one tool for another without breaking the whole system.
compound. an architectural pattern in software engineering, also known as hexagonal architecture, that decouples the core application logic from external infrastructure and interfaces. The core interacts with external components through abstract interfaces (ports) which are implemented by concrete technical handlers (adapters).
The team used ports and adapters to keep the business logic clean.
By implementing ports and adapters, the developers were able to switch from a SQL database to a NoSQL one without changing any core business rules.
The primary benefit of the ports and adapters pattern lies in its ability to isolate the domain model from the volatile nature of external frameworks, thereby enhancing long-term maintainability and testability.
Coined by Alistair Cockburn in 2005. The metaphor draws upon the physical hardware interfaces used to connect disparate equipment to a central unit.
Etymology adapted from Wiktionary, available under CC BY-SA 4.0.
Usually treated as a plural noun phrase; often used interchangeably with the term 'hexagonal architecture'.
Last updated July 22, 2026