Replies: 2 comments 3 replies
-
Hi there, thanks for the feedback!
No, that's not the case, keeping the infra independent is a good thing, although also debatable and context dependent. In that kind of architecture one spend too much time thinking about things in "technical perspective" or, in terms of horizontal technical layers. Whereas what matters more is "vertical slices" perspective (modules/components), that's to say - isolation of concerns. For small services/projects the hexagonal architecture is an overkill, even though it might feel proper/fancy. The thing is that at a small codebase (let's say less than <1K LoC) it doesn't matter what kind of architecture you pick - be it Even Sourcing or Hexagonal architecture. Things will work anyway, and despite excessive complexity would be quite maintainable (at least by the authors), given the small size of the application. Whereas for large-scale applications it shifts so precious focus from isolating business functionality to the thinking in terms of horizontal layers. One might say that we can keep focus on isolation (vertical slices), whereas maintaining hexagonal-like layering inside a given vertical slice. But we have a limited mental capacity to spend. It would be mentally taxing to keep both at a good level. Also, that kind of architecture has a high bar to entry. The sheer number of files is somewhat tripled. Other people (especially non-developers) can't use the codebase as a source of knowledge any longer, because they see all these "ports/adapters/in/out/domain/context/kernel" folders which don't contribute to the understanding of the project. A lot of gluing code, and you have to jump across the layers of abstractions here and there to get to the gist. Also, we had some discussion here: |
Beta Was this translation helpful? Give feedback.
-
I liked this section, however I think that the issue is even more rooted. I think it is more about the balance between freedom and standards. The good thing about such architecture is its ability to become a standard, which helps when you interact with multiple services. Being familiar with the standard would help you getting familiar with the code. However, over-standardization may lead to detours and anti-patterns where things are not aligned with the standard, requiring you to 'glue' the solution to fit it. Also, to perform a refactor you not only need to understand the code, but also the standard. From my experience, it is helpful to standardize layers that aid navigation through the service and its non-code dependencies and consumers, while also allowing freedom in the domain logic. |
Beta Was this translation helpful? Give feedback.
-
Hi, I really appreciate you writing this up – it's really well described.
Is it possible to share some examples of the extra complexities you've found with hexagonal architecture? My guess is that maybe you've found that always defining a domain-side interface for infastructure to be too much of a pain, and sometimes allowed your domain to depend on infra. Is tht what you mean, or something else?
Beta Was this translation helpful? Give feedback.
All reactions