Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The better approach for toolbar actions
Message
De
29/04/2003 04:41:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
The better approach for toolbar actions
Divers
Thread ID:
00782598
Message ID:
00782598
Vues:
38
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform