This article is an extension of the theoretical article Components of Enterprise Software, which discusses the combination of software design concepts, specifically Hexagonal Architecture and Clean Architecture.
It is necessary to read the previous article to understand the concepts applied here and the intended goals.
This time, we will focus primarily on practical issues, namely the implementation of the design presented earlier.
Design Proposal
The following diagram is a result of combining the teachings of Hexagonal and Clean architectures, and it provides a detailed representation of the intended design for our software.
This diagram provides a general, simple, and direct identification of all the layers in the design and their responsibilities:
Entities (or domain) — Contains the core business rules.
Use cases (or application) — Contains orchestration rules or the main operations of the application.
Interface adapters — Mediate the application’s interaction with the external world (the infrastructure).
Infrastructure (Frameworks, drivers) — The external world, which can include applications, services, libraries, APIs, etc.
Entities and use cases constitute the core of the application, the central component of the architecture (the hexagon), and are responsible for encapsulating all the business logic.
The Hexagonal Perspective
From the perspective of Hexagonal Architecture, the application should be able to:
Support multiple technologies (databases, message brokers, email services, etc.).
Be testable without having all the technologies defined.
Be developed without having all the technologies defined.