Member-only story
What is the most common mistake people do when working on the hexagonal architecture ?
Having domain logic in the driven and/or driver
Because as developers, when we are writing code, we are trying to solve problems and there so many things to take into account, like classes, functions patterns, logic, test, documentation, naming… It is very challenging to keep in mind all best practices at once.
Moreover, it’s hard to put a clear boundary in terms of logic when coding. If the concept of separation of concerns, and the boundary of the domain is not clear, developers would likely try his beset but fail to put the domain logic in the domain. At the opposite, they would likely write the logic in the adapter because it’s close to the source of data.
👉 Cause
The cause perhaps comes from the failure in design upfront, or lack/absence of design upfront.
🤷♂️ Consequence
The domain is not well isolated. Then we loose again the benefit of using this architecture style. We just deviate from the purpose of it, which aims to emphasize on the domain isolation, and allow more clarity on the domain model.