79076015

Date: 2024-10-10 20:15:07
Score: 0.5
Natty:
Report link

You need to make sure that your dependencies point in one direction (controller -> service -> repository). Then you won't have cycles.


To do this,

  1. Don't call services from other services.
  2. Feel free to call multiple repositories from your services.

P.S. Services contain business logic, including transaction management logic. Accordingly, if you have 2 repositories and you need to do some action in these repositories in one transaction, then the service is the place that will wrap the work with these repositories in one transaction.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: nik0x1