eleCtrik
eleCtrik

Needed help to refactor my code

suppose i'm following controller->service->repo structure, what if service of one domain calls the repo of another domain, can we do this? for examle there is a repo that basically deals with gold prices fetching the latest gold price from the dB, and it has it's own service layer and then i have another class called as Payment Service that deals with creating payment request so in order to get the latest gold price can my payment service call gold repo, or i should create an entry inside the payment repo that basically calls the goldPrice repo and then gives the data to payment service class.

Needed help on this.

9mo ago
Discover more
Curated from across