Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Titre:
Class and Instance Logic
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement