Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclass it or..?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00782701
Message ID:
00783738
Vues:
10
That sounds like a good approach (if i understand the question correctly!). If you don't want to overwrite the *method* you could define a property (".lDeletedFieldExists"), and in your DeleteMethod, decided what to do based on tis property. Default the property to .f., and then create a subclass where the property is set to True.

>Hi,
>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?
>
>Thank you
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform