Handling Behavior with Ports and Use Cases
Once we have defined the business rules in the Domain hexagon, we can start thinking about ways to use those rules to create software features while considering how the system will handle the data coming from users and other applications. Ports and use cases address such concerns in the hexagonal architecture, where we need to orchestrate system data and business rules to provide useful software functionality.
In this chapter, we’ll explore how to employ use cases to define the behaviors supported by the software. Through the integration of input and output ports with use cases, we’ll understand the role of such ports in establishing the communication flow within the hexagonal system.
We will cover the following topics:
- Expressing software behavior with use cases
- Implementing use cases with input ports
- Using output ports to deal with external data
- Automating behavior with the Application hexagon