Best practice to call a Repository class method in another Controller-Service-Repository in Spring Boot?

945 Views Asked by At

enter image description here

Image Description: The image represents the backend coding of my application designed in MDD architecture, say chan 1 corresponds to model Complaint and chain 2 corresponds to model Location.

Working: The client makes request to backend at Location controller passing an argument 'complaintId', and expects a Location corresponding to it. This work is to be done by method in Complaint repository using an inner join query.

Question: My question is how should I call this method: C2-S2-R1? C2-S2-S1-R1? C2-S1-R1?

(NOTE: Though there are many patterns described already in SO, solution to this question wasn't found. I would also appreciate if anyone could post an already answered link here. ty)

0

There are 0 best solutions below