Click here to Skip to main content
15,892,768 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Pattern for Shared Dropdown Tables Pin
led mike13-Jun-08 5:09
led mike13-Jun-08 5:09 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Brady Kelly13-Jun-08 8:08
Brady Kelly13-Jun-08 8:08 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Joe DiNatale12-Jun-08 6:17
Joe DiNatale12-Jun-08 6:17 
GeneralRe: Pattern for Shared Dropdown Tables Pin
led mike13-Jun-08 5:06
led mike13-Jun-08 5:06 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Mark Churchill15-Jun-08 20:22
Mark Churchill15-Jun-08 20:22 
QuestionHow to design an application to handle versioning issues? Pin
nrj2311-Jun-08 23:12
nrj2311-Jun-08 23:12 
AnswerRe: How to design an application to handle versioning issues? Pin
Ashfield13-Jun-08 2:29
Ashfield13-Jun-08 2:29 
QuestionDelete - Undo Pin
dabs10-Jun-08 14:43
dabs10-Jun-08 14:43 
It has become increasingly popular to implement Delete functions in such a way that the user will not be bothered with MessageBox confirmations, but will instead be given the option to undo his action. Gmail does it, and this is covered very well in an article at alistapart.com[^].

I've been implementing this in my own projects, and would like some input from others regarding the best design for this. In many cases, the implementation isn't terribly complex: When an entity is deleted, it is simply deleted from a table, but a copy of the deleted entity is stored on the side (for instance in ViewState if this is a web application) and the user given the option to undo his action. If the user chooses to undo, this entity is simply re-inserted into the table. If the user doesn't choose to Undo, this copy will simply get lost when the page is closed, which is very much in line with the user experience (when he closes the page he will probably expect to loose the chance to undo his action).

As I said, this might be OK under some circumstances. But then there are others. For instance, lets assume I'm writing my own blog site, I want the admin to be able to delete blog entries, and I want to implement undo as well. Each blog entry has a unique ID allocated by the database, each blog could then have zero or more comments, where each comment could be linked to another comment (similar to the messages in the CP messageboards). This would be implemented such that each comment has also a unique ID (assigned by the DB), each comment has a BlogID and a ParentCommentID. Blog posts are then linked to using their ID (myblog.com/Blog.aspx?ID=10). Let's assume that the admin now wants to delete a blog entry. By using the implementation given above, several problems arise. First, if the admin chooses to undo the deletion of a blog entry, a new entry would essentially be created, so the BlogID's of each comments would have to be updated. Also, comments would have to be relinked together since each comment would also receive a new unique ID, so all the parent ID's would have to be updated. Both of these tasks are very well manageable, but annoying. However, the biggest drawback lies in the fact that any links to this post are now invalid, since the blog entry wasn't really undeleted, a new one with the same content was created but with a new ID. So this implementation doesn't guarantee that the system is in the same state as it was before the delete/undo combo.

Another implementation could be like this: When an entry is deleted, it is in fact not actually deleted, but instead marked as deleted (this requires a new column in the table, and it requires all get-queries to be rewritten so they don't fetch deleted entries. Again: a bit annoying but perfectly manageable). This means that Undo is much simpler: it simply removes the "Deleted" flag from that row. But the question remains: when is the record actually deleted? Should we maybe not bother with it? Should we implement an "Empty trash" function for the admin as well? And should we implement undo for that as well?

As you can tell I have a LOT of questions. Feel free to answer as many or as few as you like Smile | :) I'm basically checking if I'm missing something obvious, or if anyone has given something similar any thought.

Bottom line: how do you implement Delete/Undo in your (web) applications?



Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!


AnswerRe: Delete - Undo Pin
led mike11-Jun-08 4:45
led mike11-Jun-08 4:45 
QuestionProtocol for communicating over socket ? Pin
Noctris10-Jun-08 12:24
Noctris10-Jun-08 12:24 
AnswerRe: Protocol for communicating over socket ? Pin
Ray Cassick10-Jun-08 13:51
Ray Cassick10-Jun-08 13:51 
QuestionRe: Protocol for communicating over socket ? Pin
Noctris10-Jun-08 23:04
Noctris10-Jun-08 23:04 
AnswerRe: Protocol for communicating over socket ? Pin
led mike11-Jun-08 4:30
led mike11-Jun-08 4:30 
QuestionCreating controls on the fly approach???? Pin
rulllesss8-Jun-08 22:27
rulllesss8-Jun-08 22:27 
AnswerRe: Creating controls on the fly approach???? Pin
led mike10-Jun-08 4:27
led mike10-Jun-08 4:27 
QuestionObject Orientated Programming - Association,Composition and Aggregation (Multiple Languages) Pin
Tom Moore7-Jun-08 11:06
Tom Moore7-Jun-08 11:06 
AnswerRe: Object Orientated Programming - Association,Composition and Aggregation (Multiple Languages) Pin
stavinski8-Jun-08 0:30
stavinski8-Jun-08 0:30 
GeneralRe: Object Orientated Programming - Association,Composition and Aggregation (Multiple Languages) Pin
Member 276708410-Jun-08 3:10
Member 276708410-Jun-08 3:10 
GeneralRe: Object Orientated Programming - Association,Composition and Aggregation (Multiple Languages) Pin
Hasan Jaffal17-Jun-08 3:42
Hasan Jaffal17-Jun-08 3:42 
GeneralUnity Pin
Brady Kelly6-Jun-08 2:20
Brady Kelly6-Jun-08 2:20 
JokeRe: Unity Pin
Pete O'Hanlon6-Jun-08 4:00
mvePete O'Hanlon6-Jun-08 4:00 
GeneralRe: Unity Pin
Luc Pattyn11-Jun-08 10:27
sitebuilderLuc Pattyn11-Jun-08 10:27 
GeneralRe: Unity Pin
Pete O'Hanlon11-Jun-08 10:52
mvePete O'Hanlon11-Jun-08 10:52 
QuestionPost-hoc unit testing, and increasing the unit test coverage rate? Pin
Philip Laureano5-Jun-08 13:51
Philip Laureano5-Jun-08 13:51 
AnswerRe: Post-hoc unit testing, and increasing the unit test coverage rate? Pin
led mike6-Jun-08 4:34
led mike6-Jun-08 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.