Architecture Styles

Hexagonal Architecture: Ports and Adapters

Isolate your domain from infrastructure by inverting dependencies — the application core knows nothing about HTTP, databases, or queues.

February 1, 2026
#hexagonal#clean-architecture#design-patterns

Hexagonal architecture (Alistair Cockburn, 2005) places the application core at the centre with Ports (interfaces) on the boundary and Adapters as the implementations that connect to the outside world. The domain never imports infrastructure code — it imports only its own interfaces. Infrastructure imports the domain. This makes it trivial to swap databases, test without HTTP, or add a new delivery mechanism.

Continue reading