Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclass it or..?
Message
De
01/05/2003 01:40:10
 
 
À
29/04/2003 10:42:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00782701
Message ID:
00783565
Vues:
10
>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.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform