As a follow up to my previous question, I’m curious as to how Spring Data REST is normally used? It seems that sometimes it requires three service calls to do one thing that can be done in a much cleaner way with a custom service. For example, say you have an existing object A, which contains a list of object Bs. If you want to add a new B to the list you need to do a GET to get object A, a POST to create object B, and a PUT to add it to object A’s list. We also have to account for the case where object B already exists, but just isn’t in the list. Or exists and is in the list. Or object A doesn’t exist at all.
It seems like a custom service to do all of that makes sense. It reduces copied code (if it has to be done in multiple places), and encapsulates all of the logic.
Am I missing something? Or do I just have to accept how SDR does it?