Hexagonal Architecture - Should I put repository interface in the Domain Layer or Application Layer

Viewed 221

I can't find the ultimate answer for hexagonal architecture.

The question is in the title.

Should I put the repository interface in the Domain Layer or Application Layer ? Both seems to be correct but what is the main difference ?

1 Answers

This question has nothing to do with hexagonal architecture, but with DDD. And according to DDĎ, the repository interface bekongs to the domain model. As a direct client of the domain, application layer calls the methods on repository interface.

Related