0

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?

eugenedrvnk
  • 408
  • 1
  • 5
  • 10

1 Answers1

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