Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only