Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The better approach for toolbar actions
Message
From
29/04/2003 04:41:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
The better approach for toolbar actions
Miscellaneous
Thread ID:
00782598
Message ID:
00782598
Views:
39
Assuming we do have multi window application where each window is a book comprising several tabs ( let's "HitList" , "Book" , "Index" ). Each book is associated with certain table. We want to copy/print selected item(s) and navigate ( first , previous , next , last ) using a toolbar or application menu in currently selected book/tab . What needs to be copied/printed may differ from book to book ( we might include additional book specific fields) . What would be the better approach to handle the situation like this ( from OOP and subsequent maintenance points of view )

1. Have global class CopyManager doing in method CopyItem something like

DO CASE
CASE _screen.activeform.name = "FORM1"
copy something
CASE _screen.activeform.name = "FORM2"
copy something else
ENDCASE

There is no real difference to global function CopyItem in this case.

2. In each form for the particular book override method CopyItem inherited from abstract method in let's say barebookform class. Or instead of abstract method CopyItem to have something pretty similar to 1

DO CASE
CASE thisform.name = "FORM1"
copy something
CASE thisform.name = "FORM2"
copy something else
ENDCASE



TIA
Michael
Next
Reply
Map
View

Click here to load this message in the networking platform