Wrapping Business Rules inside Domain Hexagon
In the previous chapter, we learned about the Domain as the first hexagon in hexagonal architecture. By being the innermost hexagon, the Domain does not depend on any code from the Application and Framework hexagons. Also, we make all the other hexagons depend on the Domain to conduct their operations. This kind of arrangement confers the Domain hexagon a degree of responsibility and relevance far higher than other hexagons. We employ such an arrangement because it is in the Domain where we group all the business rules and data that most represent the problem we try to solve.
Among the techniques to model a problem domain, Domain-Driven Design (DDD) is widely adopted in projects that emphasize software code as a medium to convey knowledge about a business. An ever-present concern to separate what constitutes the core problem domain and what is secondary to it makes DDD a suitable approach to support the hexagonal architecture goal of...