Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating different insert operation method vs creating single insert method and reuse in usecase? #56

Open
akmalhazim opened this issue Oct 27, 2020 · 2 comments

Comments

@akmalhazim
Copy link

Hello,
Sorry for too many questions. I've been studying this architecture lately and came up across this question?

Is it better to create a single Create() method in repository layer and have many usecase methods that creates the entity or having different method for Create() operation in repository layer for so every usecase that requires a Create() method could have it's own dedicated method for creating the entity?

Appreciate your feedback. Thank you and have a nice day ahead.

@frederikhors
Copy link

I think the second one.

@bxcodec
Copy link
Owner

bxcodec commented Aug 4, 2022

Agree with @frederikhors
The repository is meant to be re-used by the usecase/service layer as the orchestrator. The service layer knows which repos they want, and orchestrates the repos as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants