Design Patterns · Senior · Question 8 of 75

What's the idea of hexagonal architecture (Ports & Adapters)?

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.

Further reading

Problem with a question

Design Patterns · Senior · question 8

Test yourself

Take the Design Patterns · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz