I personally like PUT even for delta updates, but a dev I was working with was obsessed with wanting PATCH.
I personally like PUT even for delta updates, but a dev I was working with was obsessed with wanting PATCH.
* POST: create new object, including their primary keys. Run appropriate sanity checks.
* PUT: extract old entity object and update all attributes and dependencies, possibly deleting and regenerating all dependencies while preserving the object's keys.
* PATCH: extract old entity object and update a small subset of its attributes. Run sanity checks that are specific to this form of update, and avoid touching bits in the persistence layer that are not linked with the update.
Put is very important because total entity replacements really don't replace the role of partial updates, particularly if we consider how extensive transactions can become.
Unless, of course, I am mistaken.
PUT: create new object at a known location. object need not exist. if it does, it is replaced.
PATCH: change an object.
POST: send arbitrary data to an object. this may or may not lead to the creation of a new object at another location.