Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclass it or..?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00782701
Message ID:
00783738
Views:
11
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
Previous
Reply
Map
View

Click here to load this message in the networking platform