Hexagonal Architecture

Turkish equivalent: altıgen mimariDomain: Software Engineering

An architectural style that keeps application/domain logic behind ports and connects databases, HTTP, messaging and other infrastructure through adapters.

Hexagonal Architecture (Ports and Adapters) is primarily about dependency direction, not folder naming or drawing a hexagon.

Ports

A port represents a contract exposed or required by the application. A use case such as "register customer" or a data-access requirement such as "load customer state" can be expressed through ports.

Adapters

HTTP controllers, Oracle repositories, filesystems, message brokers and test doubles are adapters around those contracts. Infrastructure can change without forcing the application/domain logic to depend directly on the new implementation.

Testability

Business rules should be testable without requiring a real database or HTTP server. That separation is particularly useful when dependencies are slow or failure-prone because failure scenarios can be tested explicitly.

Boundary

Creating an interface for every class does not create a hexagonal architecture. If contracts do not represent meaningful application boundaries, the design only gains abstraction overhead.

Related: Ports and Adapters, Dependency Inversion, domain model.