Ports and Adapters¶
Core business logic should be isolated from external concerns (databases, UIs, external services) through ports that define required interfaces and adapters that implement them
Tension Addressed¶
Coupling vs. Flexibility
Recognizable As¶
Repository interfaces defined by domain, implemented by persistence; application core with no framework imports; testable business logic without mocking infrastructure; external dependencies wired at composition root
Canonical Sources¶
Cockburn, "Hexagonal Architecture" (2005); Freeman & Pryce, "Growing Object-Oriented Software, Guided by Tests" (2009)
Transfers To¶
Hardware Design (driver interfaces), Electronics (standardized connectors), International Trade (customs interfaces), Diplomacy (ambassadors as adapters)
Also known as hexagonal architecture or clean architecture. The key insight is that I/O is a detail - business rules should be independent of delivery mechanism.
Related Concepts¶
- Coupling - Software Architecture