---
title: "Hexagonal Architecture"
section: "concepts"
type: "concept"
created: "2026-08-25"
updated: "2026-08-25"
tags: ["principle", "workflow"]
canonical: "https://pyweb.dev/wiki/hexagonal-architecture"
---
# Hexagonal Architecture

Also known as "Ports and Adapters," an architectural pattern created by [alistair cockburn](/wiki/alistair-cockburn) that isolates business logic from external systems through well-defined interfaces. This pattern directly influenced [clean architecture](/wiki/clean-architecture) and emphasizes the separation of core application logic from external concerns.

## Core Concept

The hexagonal shape represents the application core surrounded by ports (interfaces) that connect to external adapters. Business logic remains independent of databases, user interfaces, and external services by communicating through ports rather than direct dependencies.

## Relationship to Clean Architecture

[robert c martin](/wiki/robert-c-martin)'s [clean architecture](/wiki/clean-architecture) synthesis incorporated hexagonal architecture principles, particularly:
- **Port-adapter separation** — mirrors the interface adapter layer
- **Business logic isolation** — core of the innermost entities layer  
- **[dependency rule](/wiki/dependency-rule) compliance** — dependencies point toward business logic

## Adoption

The pattern was notably adopted by [steve freeman](/wiki/steve-freeman) and [nat pryce](/wiki/nat-pryce) in "Growing Object Oriented Software" and became a foundational element in the broader architectural synthesis that led to [clean architecture](/wiki/clean-architecture).

 [[source: uncle-bob-clean-architecture-2012]](/wiki/raw/articles/uncle-bob-clean-architecture-2012)

---

## Agent Navigation

cluster: person (170 pages) | betweenness: 19.4

### References (outbound)
- [Alistair Cockburn](https://pyweb.dev/wiki/alistair-cockburn.md)
- [Robert C. Martin (Uncle Bob)](https://pyweb.dev/wiki/robert-c-martin.md)
- [Dependency Rule](https://pyweb.dev/wiki/dependency-rule.md)
- [Steve Freeman](https://pyweb.dev/wiki/steve-freeman.md)

### Referenced by (inbound)
- [Clean Architecture](https://pyweb.dev/wiki/clean-architecture.md)
- [Codex Harness Architecture](https://pyweb.dev/wiki/codex-harness-architecture.md)
- [Alistair Cockburn](https://pyweb.dev/wiki/alistair-cockburn.md)
- [Nat Pryce](https://pyweb.dev/wiki/nat-pryce.md)
- [Steve Freeman](https://pyweb.dev/wiki/steve-freeman.md)

### Evidence (verified primary sources)
- [uncle-bob-clean-architecture-2012](https://pyweb.dev/wiki/raw/articles/uncle-bob-clean-architecture-2012.md) | origin: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html | ingested: 2026-08-25 | sha256: b99ae450b5981dbee264aec42701b920ce96ccedea01d03243ea48c414442379

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
