Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

315
Visualizações
Make repository invisible in domain layer of Clean Architecture

I recently heard and researched about Clean Architecture and am trying to implement it on my own to understand it deeply, I know Domain module(layer) has the logic and should have some interfaces as well as UseCases which use the repositories. As far as I learned, the Domain layer does not have access to any other layers but Data and Presentation layer has access to the Domain layer but not to each other.

My repositories definition (Interfaces) are in the Domain module and their implementation is in Data module and then injected by Dagger. Also, I have some UseCases which inject some repositories.

The problem that I have is, the Presentation module has access to the repositories interfaces and use-cases as both are in the Domain module and are imported with gradle in the Presentation layer.

I do not think having access to both in the Presentation module would be good, I am using Kotlin and internal keyword to isolate classes for each module but as Data module needs to have access to repositories interfaces to implement them, I cannot use internal keyword for them so they are exposed now.

My question is, would it be possible to change the design somehow to expose only the use-cases?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If UseCase is related to data (e.g. ReadUserUseCase), then it's interface should stay in the domain module and the implementation should be moved to the data module.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda