nest-clean-architecture icon indicating copy to clipboard operation
nest-clean-architecture copied to clipboard

Do `ports` really belong to infrastructure or just their `adapters`?

Open leonardbinet opened this issue 1 year ago β€’ 0 comments

First, πŸ‘ @VincentJouanne this clean architecture template is awesome (and I've checked a few).

Small suggestion, in your example, ports belong to the infrastructure directory: Screenshot 2023-03-14 at 21 45 22

Whereas I think those interfaces should belong to the domain.

Quoted from this article: https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/

It’s important to note that the Ports (Interfaces) belong inside the business logic, while the adapters belong outside. For this pattern to work as it should, it is of utmost importance that the Ports are created to fit the Application Core needs and not simply mimic the tools APIs.

leonardbinet avatar Mar 14 '23 20:03 leonardbinet