Hexagonal architecture centers an application on its business logic and connects it to the outside through ports and adapters. The business logic defines ports; adapters handle external requests or carry out external operations. The business logic does not depend on adapters—the adapters depend on it. section 3.3.2
Separate the two directions of interaction:
- Inbound ports expose business operations. Inbound adapters, such as web controllers or message handlers, invoke those ports; multiple adapters can use the same port. section 3.3.2
- Outbound ports define how business logic requests external services. Outbound adapters implement those ports, for example through database access objects or remote-service proxies. section 3.3.2
FTGO food ordering
FTGO places Order Management, Delivery Management, Billing, and Payments business logic behind adapters. REST and web interfaces handle inbound requests; outbound adapters connect to MySQL and services such as Stripe and Twilio. The application is logically modular but packaged as a single WAR. section 2.1.1
Figure 3.16 An example of a hexagonal architecture, which consists of the business logic and one or more adapters that communicate with external systems. The business logic has one or more ports. Inbound adapters, which handles requests from external systems, invoke an inbound port. An outbound adapter implements an outbound port and invokes an external system.
Use the diagram to trace how inbound adapters invoke ports and outbound adapters connect business logic to external systems. section 3.3.2










