Hexagonal Architecture (Ports & Adapters)
"Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases." — Alistair Cockburn, người tạo ra Hexagonal Architecture
Hexagonal Architecture (còn gọi là Ports & Adapters Architecture hay Clean Architecture's spiritual predecessor) là một kiểu kiến trúc phần mềm được Alistair Cockburn giới thiệu vào năm 2005. Ý tưởng cốt lõi là đặt business logic vào trung tâm (inside) và tất cả các tương tác với thế giới bên ngoài (database, web, message queue, UI) đều thông qua các ports (cổng) và adapters (bộ chuyển đổi) ở rìa (outside). Điều này tạo ra một hệ thống mà business logic hoàn toàn độc lập với infrastructure — có thể test, phát triển, và thay đổi mà không bị ảnh hưởng bởi công nghệ bên ngoài.