4 ms·
In CRUD, delete is rarely a hard delete that removes the data entirely. Best practice in most situations is setting a flag to mark it deleted. Closing an acco
by binarymax 10y ago
In CRUD, delete is rarely a hard delete that removes the data entirely. Best practice in most situations is setting a flag to mark it deleted. Closing an account is the same behavior - you are not purging the data, rather setting it to a closed/deleted/archived state.
- caseysoftware 10y agoYou're packing a lot of implied behavior - based on your experiences - into the DELETE verb instead of using the dictionary definition. If everyone has experience with similar systems, then you're fine. If others have worked with hard delete systems or aren't native English speakers, you're introducing ambiguity and context that isn't necessarily there.
- binarymax 10y agoUsing DELETE this way is absolutely not introducing or implying anything, this is best-practice REST. It signifies exactly the behavior I describe.
- pc86 10y agoDELETE simply means subsequent calls to GET should not return that object. So you can call DELETE on an account then your next GET returns a 404 because you deleted it from the database, or you can call DELETE and your next GET returns a 405 because the account has been closed and you're not allowed to call GET on a closed account. Both are totally within the spirit of what DELETE is supposed to accomplish, and I'm sure there are a half dozen other ways to architect it completely within the spirit of DELETE and REST as well.