# Ports and Adapters Architecture

Record: `arch:ports-and-adapters-architecture`
Kind: style
Layer: [Structural Core](https://banes-lab.com/records/layer/structural-core.md)
Severity: recommended
Scope: application, service, component
Canonical: https://banes-lab.com/ontology#arch-ports-and-adapters-architecture

## Repair

- Refactored by: Introduce Port, Extract Adapter
- Detected by: inward/outward dependency violations
- Violated by: domain/application importing infrastructure
- Measured by: adapter coverage, boundary purity
- Enforced by: layer dependency rules

## requires

- [Ports](https://banes-lab.com/records/lex/ports.md)
- [Adapters](https://banes-lab.com/records/lex/adapters.md)
- [Dependency Inversion Principle (DIP)](https://banes-lab.com/records/arch/dependency-inversion.md)

## reinforces

- [Replaceability](https://banes-lab.com/records/arch/replaceability.md)
- [Testability](https://banes-lab.com/records/arch/testability.md)

## enables

- [Infrastructure Independence](https://banes-lab.com/records/lex/infrastructure-independence.md)

## conflicts-with

- [Infrastructure-Centric Design](https://banes-lab.com/records/lex/infrastructure-centric-design.md)
- [Framework Leakage](https://banes-lab.com/records/arch/framework-leakage.md)

## tensions-with

- [Boilerplate](https://banes-lab.com/records/lex/boilerplate.md)

## tensions

- [Ports and Adapters Architecture Boilerplate](https://banes-lab.com/records/tension/boilerplate-ports-and-adapters-architecture.md)
