Design Patterns · Senior · Question 8 of 75
What's the idea of hexagonal architecture (Ports & Adapters)?
- ✓Correct answer: The core talks to the world through port interfaces, and adapters implement them
- 2The app is divided into six mandatory layers with fixed names
- 3Each module connects to its neighbors through exactly six links
Explanation
A port is an interface such as PaymentPort; adapters are Stripe, a mock, a test implementation. The core knows nothing about HTTP, the DB or the UI. The idea is close to Clean Architecture and DIP; on the frontend, ports are often expressed as hooks or injected services.