DEV Community

Discussion on: Hexagonal Architecture in Go

Collapse
 
prinick profile image
Brayan Narváez • Edited

Hi! thanks for comment.

I will try to explain me, although my English is bad.

In the classic 3 layer architecture, the main problem is that the app is not focus in the domain, the domain layer has dependencies with the data layer for example, and that make it less scalable.

The clean architectures is a set of principles whose main purpose is to hide the implementation details from the domain logic of the application.

And.. the Hexagonal is a model of clean architecture, is better for be independent from frameworks, more testeable, independent of the data base and focus the domain.

If you need maintain an application, this propose is nice because you have lose coupling between the elements of your app.

If you need change the implementation of your database engine for example, you can do it without affect the domain business logic, for example.

If you want your app work with CLI Command line instead of API REST, you can do it without affect the domain business logic and infrastructure implementation.

Is the SOLID principles in macro scale.

Collapse
 
codewander profile image
codewander

Thanks. I should have said I am familiar with hexagonal and have implemented, just curious as to why you think it's the best choice in your current vision for requirements? Do you want to be able to change databases, etc?

Thread Thread
 
prinick profile image
Brayan Narváez

Maybe, change the database engine is not for all cases, but a big change in version can be an example, or the update of API REST framework library use in the upper layer of the app.

Simply is more easy make small and big changes.