Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Good reason to never use form methods
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00415216
Message ID:
00417442
Vues:
21
Jim,
In all honesty, since most of what we create are specific applications rather than application frameworks, there is very little downside, If we decide to make a form or a control into a class, the PRG just becomes core code of the base class, but still lives in a PRG/FXP external to the class library. This actually makes it easier to modify/tweak the behavior of the base class because you can do so while an object of the class itself is instantiated, which is impossible when using the class builder.

Whenever controls or forms that use external PRGs are made into a class, you can still subclass them and modifiy their behavior because their methods can still also be subclassed. It's just that the default processing of the base class is done by an external PRG (sometimes there are several procedures in it). This does not prevent subclassing any more than putting all code into the VCX itself. It does add a bit of confusion to project maintenance, to be sure. Whever goes the VCX, so must go the "external" FXP.

Private data sessions and/or multiple instances of the same form have no affect here. It's all just a matter of where the code is located. The objects and data passed to the code (e.g., the object reference that is passed if multiple objects of same class are instanced) is what determines which instance will be affected.

I have personally never run into the problem of a "switched data session" if I pass THISFORM from a private data session form to an external PRG. But this might be an accidental consequence of something else I'm doing that keeps the problem from happening. Dunno. I'm not a datasession guru by any means. They generally confuse me.

>John and Mark,
>
>So how do you guys override or enhance behavior in certain instances of a control? How does your inheritance work? How does your approach support polymorphism? Do you keep your prg's with the class libraries or with the forms themselves? Do you have any forms with a private data session, (UDFs run in the data session 1)?
>
>Just a few little problems you may run into later.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform