mercredi 2 août 2023

Use cases vs Domain vs Repositories: Where should the business logic reside?

Upon using Clean Architecture for multiple Android projects, I always stumbling with a temptation on where is the best location to put the business logic. Based on my understanding Domain Model holds some business logic and value objects that solves problems like formatting or encoding, Use Cases on the other hand provides the "Screaming Architecture" concept to make actions and processes more readable in a business perspective but in abstract. There is also Repositories that are responsible for transmitting/receiving data but can also have business logic in it.

My questions are:

  1. Is it possible for Use Cases to have business logic as well? If yes what kind of business logic it can have?
  2. What kind of business logic Repositories usually have aside from transmitting/receiving of DTOs?

Aucun commentaire:

Enregistrer un commentaire