general architect question

G

Guest

In the database design I'm using a soft delete (a column flaged as IsDeleted)
instead of a hard delete, what should you do if the item is deleted in one
table yet you go a create a dropdownlist with a list of items and record you
bring up has that soft deleted item so you try to "set" the selected vaue to
it and it no longer is in the list since your sql statement looks for
IsDeleted = 0? You'll get an error not in the list anymore (not an item in
the list). You could Try/ Catch it. But is there a more common way to
prevent/avoid this?

Thanx.
 
S

Steve Lutz

Chris,

That's more of a User Interface issue. What do you want the user to see when
they open a detail field, but the selected item has been "soft deleted"?
What is the user expecting to see? It may lead you down the path of other
issues to.

Say for example, the database is a list of songs, and each song has a
category, say Rock, Easy, Classical, etc. But then you soft deleted Rock, so
that you could expand it to Hard Rock and Modern Rock. When a user looks at
the song with the old Rock category, what do you expect them to see? You
have the option of doing soft-cateogization as well - not using foreign
keys.
Just store the categorization value (string) into the field. But this leads
to data-integrity issues.

HTH

Steve
 
G

Guest

exactly, the problem. I could adjust the presentation to detect that the item
is no longer available, not adding or selecting it, or add the item back to
the list. If I don't make it available then if the user saves the record it
will change the value for that field. Now it could be a good thing, but also
bad for history (reporting).

I might just add it to the list again, making it selected for modifing that
particulaer form data. Thought I'd ask if there was other approaches, thanx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top