Skip to main content
5 events
when toggle format what by license comment
Jul 9, 2021 at 16:26 comment added Stack Exchange Broke The Law @Héctor If the service is getting called, then isn't it the caller's problem, that he put a book which doesn't exist in the user's bookshelf? The caller should never do that, right? You are talking about adding an entire dependency just so you can assert that a programmer didn't make a mistake!
Jul 6, 2021 at 16:08 vote accept Héctor Valls
Jul 6, 2021 at 15:50 comment added Hans-Martin Mosner If that is a hard requirement on this service, then you need to bite the bullet and add the book ID verification to the API. It will slightly slow down the API, and you might encounter the need for performance optimizations earlier, but that's the cost you pay for the given requirements. You may also consider the relative frequency of PUT operations versus GET operations returning lists of book IDs - it might be more efficient to filter out invalid IDs at that stage.
Jul 6, 2021 at 11:33 comment added Héctor Valls Isn't a problem to store books status of books that doesn't exist? (arbitrary IDs) Isn't that corrupted data? When I ask user's pending books from the microservice, it will return non-existing book IDs.
Jul 6, 2021 at 10:37 history answered Hans-Martin Mosner CC BY-SA 4.0