Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If inheritance is a prime reason for OOP, then why...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00171748
Message ID:
00176260
Vues:
37
Hi Jack,

This is a great thread, there's really a lot of useful ideas here. In reading your messages I think there's something else to consider here. If you're constantly running into these issues it might indicate that the methods you're using might not be the best choices. I understand why you've placed this code in the Form's Load event, but obviously, you're developers need to frequently add code here.

I just messed around with this a little bit and here's something that might help you. I did a create class frmJack of Jack as Form. Then in the LOAD method I stuck in SET EXCLUSIVE OFF, SET DELETED ON, SET TALK OFF This.LoadHook(), then I hid the load method.

Next, I did a create form testform as frmJack from Jack. The Load method doesn't show up in the property sheet. Just to make sure this worked, then I added a WAIT WINDOW to the LoadHook method and ran the form.

IOW, what I'm trying to say is if you have things that absolutely must happen in your classes, then devise ways to force them to happen without losing flexibility.

Steven Black's web site, www.stevenblack.com, has an article about the "Hook Design Pattern" you might want to take a look at. Basically, you can implement something along those lines and in addition to what the article says, hide the actual implementation methods so eliminate the possibility of another developer putting code into them to override them.
Mike Feltman

F1 Technologies
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform