Wednesday, February 13, 2008

REST-based service design, v2

This content has moved permanently to:
https://blog.jonm.dev/posts/rest-based-service-design-v2/

2 comments:

Mat Schaffer said...

One thing that "smells" to me about this is that you've created a data service with three operations. Read, Update and Delete. Where Update is an implied Create. Since CRUD is such a common acronym I can't help but think that there's some reason not to cause implicit data creation. I can't say I know what that reason is, but it's probably worth it to investigate.

Jon Moore said...

Yes, I can see where you're coming from. In this case, in the way I'm thinking about it, there isn't any data to update -- the only data we care about is whether the resource exists or not (i.e. the boolean flag of whether a food is a favorite or not). So I think this is just a degenerate case. Maybe the right way to look at this is that we've created a resource with Create, Read, and Delete, but no Update. So it's CRD. That might make it smell a little less?