Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class and Instance Logic
Message
De
01/08/2001 09:04:56
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Class and Instance Logic
Divers
Thread ID:
00538248
Message ID:
00538248
Vues:
47
Is the following an example of a sound practice, or is there a better approach?

Command button class named: cmd_ClassNew

First instance: ThisForm.PageFrame.Page1.cmd_New1
Second instance: ThisForm.PageFrame.Page2.cmd_New2

In cmd_ClassNew.Click there is code to run ThisForm.AddProc().

In both cmd_New1.Click and cmd_New2.Click is code to store the current view as ThisForm.CurrentView. Then I issue DoDefault() and perform things like PageFrame.ActivePage and Object.SetFocus relevant to the particular instance.

The ThisForm.AddProc() method contains code to add a new record based on the ThisForm.CurrentView. I use a case statement to handle the logic.

Any opinions? I apply this logic to other objects as well, but command buttons were the easiest to describe. Seems I've read somewhere that objects should only know about themselves (or something like that) and wondered what the best way to handle class/instance logic was. Just trying to make sure I'm doing the best by my apps. Thanks!

Renoir
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform