Ari Nurcahya
Jul 26, 2022

--

if your table on your database is from one domains you don't need to use 3 repositories. example, the table `user`, `user_role`, `user_address` are from the one domain which means it's a user domain, so you can join and use one repository.

but if your table came from another domain, example the `book` and the relation is user has many books.

you should separete the book and the user on the different domain.

for the data retrieving I usually aggregate the data on the service level, not at the database level (which means the repository)

--

--

Ari Nurcahya
Ari Nurcahya

No responses yet