I have PostsRepository where I handle the process of post creation for user. But where "PostsRepository.create" method should be executed? In UsersService or PostsService?
Asked
Active
Viewed 24 times
1 Answers
0
But where "PostsRepository.create" method should be executed? In UsersService or PostsService?
PostsRepository.create
should be executed in PostsService
as PostsService
should concern only about Posts
. UsersService
should have methods which have high cohesion with UsersService
. I mean UsersService
should only have methods which work only with Users
.

StepUp
- 36,391
- 15
- 88
- 148