the CMS our chief coder designed has the update/insert actions handled by one controller. Most of the CMS's I see has separate handlers for update and insert. Why are most CMS's designed this way? Even the REST pattern has separate actions for update and insert (I don't know what they're exactly called though).
views:
40answers:
2
A:
Probably because it's two of the four basic CRUD operations found in user interfaces. It's more intuitive, easier and safer to perform a single "Edit" operation on data than performing a "Remove" operation then an "Add" operation.
In silico
2010-09-20 03:44:59
that may be it probably, but are there any functional reasons or advantages for doing so?
Ygam
2010-09-20 03:47:54
Yes. Doing a single edit is easier and safer than removing then adding data.
In silico
2010-09-20 04:24:00
A:
Depending on how the data is persisted, an "update" will not change the identity/primary key, while a remove/insert combination could result in a new identity/primary key. If that primary key is referenced elsewhere (say, in a URL), then that reference will no longer work.
mgroves
2010-09-20 06:59:06