>I have built simple data access object. It have add, delete, load, save and etc method.
>As usual, save will do TABLEUPDATE, Delete will issue DELETE and ....
>Now, I have few tables that, records should always there even "deleted", such as Invoice, .. therefore, I add new field lDeleted to tables and write it to .T. if "deleted".
>Since I have 2 different delete behavours, should I subclass my class (that issue delete command) and override it by Update ...SET lDeleted = .T. just becoz of this reason?
>Or, Any other better solution?
If you have a data dictionary, you could add a field to define that functionality on the tables where it would apply. So, at least, you'll have a flag in such a field in the data dictionary for your Invoice table. Then, in your class, whenever you are up to delete, you could do this checkup to see how you will react. Basically, I will keep it as is but just rely on such mechanism for the decision mechanism when deleting.