Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object as form property
Message
De
05/10/2007 10:02:35
 
 
À
05/10/2007 09:26:17
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01258596
Message ID:
01258905
Vues:
10
>>While the other advice you've been given is correct, unless there's a good reason, I'd add the property in the Form Designer and just assign it in Init.
>>
>>Tamar
>
>What would drive the decision to do it one way or another?

If the property is always or almost always needed, it's better design to put in the class than to create it in an instance.

Sometimes, you have a class that you can't or aren't allowed to change (like from a library of some sort), so you have to add properties at runtime.

Also, there are some kinds of things you want to do that are better handled by runtime additions. For example, generic code to handle resizing often adds properties to hold onto some base values. The advantage of doing it that way is that the specific objects don't have to know anything about the generic code.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform