Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 Events
Message
From
02/01/2001 17:17:53
 
 
To
02/01/2001 16:15:08
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00458642
Message ID:
00458676
Views:
25
>Hi!
>
>Does any one know if in VFP7 the default behavior of processing Events/Methods has changed from "Override" to "Extend"?
>
>What I mean by that is, the default behavior in VFP6 is to Override the parent's Event/Method by default. If we want to Extend the behavior we have to execute "DoDefault()" every time in every child's Event/Method if we want the parent's Event/Method to fire, which I think is really a pain in the a##.
>
>I think we should have a menu option (or some other way) to specify whether we want to Extend the parents behavior or Override it.
>
>i.e. Every Event/Method should have a property that could be either “Extend” or "Override" and "Extend" should be the default.
>
>What are your thoughts on this?
>
>
>Sarosh

I tend to agree with the others who have said that the way it is works pretty well, and to change the methodology would break so much code it wouldn't be worth it (unless of course enough other things broke enough code as well, but I digress).

However, I also rather prefer coding the superclasses so I don't have to use DoDefault() very much. e.g., a typical Save() method.
The superclass Save() contains all the necessary code to save any data, w/o needing any coding at the child level.
The only child specific code needed would be to check required fields and to validate data using other business rules.
In this case, the superclass would have the CheckRequiredFields() and IsValid() methods (as an interface), with no default code except to maybe return a value indicating success (RETURN .T. or RETURN 0, etc.).
The CheckRequiredFields() and IsValid() methods are overwritten by the child level. In none of these methods would a DoDefault() be required in the child.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform