Hexagonal architecture, also called Ports and Adapters, separates core business logic from external systems. The core defines ports that express what it needs; adapters connect those ports to particular services. This makes external boundaries easier to reconfigure and supports different deployment contexts. section 15.8.1
A payment integration illustrates how the boundaries work:
- A payment port describes the functionality the application needs, rather than every capability offered by a payment provider. section 15.8.1
- A Stripe adapter connects that port to the Stripe API. Other adapters can be selected through configuration. section 15.8.1
- Tests can enter through an inbound port or replace an outbound service adapter with a stub. section 15.8.1
Inbound connections can include a UI or message broker; outbound dependencies can include databases or web services. The pattern brings separation of concerns and inversion of control together under one ports-and-adapters model. section 15.8.1
Figure 15.8 In hexagonal architectures, external services connect to the domain logic through ports and adapters

Use the schematic to visualize external systems connecting to domain logic through ports and adapters. section 15.8.1










