How does this help me build maintainable software?
Managing boundaries between domains is one of the hardest parts of software development. In a small code base, boundaries might not be necessary because the mental model of the whole code base still fits into our brain’s working memory. But as soon as the code base reaches a certain size, we should make sure to introduce boundaries between domains, so we can reason about each domain in isolation. If we don’t do this, dependencies will creep in, turning our code base into one of those dreaded “big balls of mud.”
Hexagonal Architecture is all about managing a boundary between an application and the outside world. The boundary is made up of certain input ports provided by the application and certain output ports expected by the application.
Hexagonal Architecture does not help us to manage finer-grained boundaries within our application. Inside our “hexagon,” we can do whatever we want....