Re: 409 Conflict - exposing more details

On 14.02.2011 19:34, Jan Algermissen wrote:
> Julian.
>
> On Feb 14, 2011, at 5:02 PM, Julian Reschke wrote:
>
>> Hi,
>>
>> in a project I'm currently working on, my server returns 409 Conflict when trying to DELETE a resource that still has strong references from other resources -- so what I want to tell the client is that you can't DELETE resource A as long as resource B references it.
>>
>> Now, with close coupling between client and server this can easily be communicated in the response body, be it JSON or XML.
>>
>> However, I was wondering whether this use case is common enough to standardize it? Maybe with a link relation?
>
> Not sure. I think I would try to model the aggregate in a way that the parts (that cannot exist without the whole) have URIs that are below the aggregate's URI. That way, they are automatically 'removed'. Part-whole relations being synonymous for your 'strong reference'.
>
> So it is maybe more a design problem than a technical one?
>
> Jan

For many relations this works and of course is preferable.

In the case I'm currently looking there's a mix of references I can 
expose as URI hierarchy (and I do), and some others that do not seem to fit.

I may be able to workaround this by defining multiple hierarchies (like 
in WebDAV bindings), but this seems to be a rather complex solution to 
what should be a simple problem...


Best regards, Julian

Received on Monday, 14 February 2011 18:41:28 UTC