Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateObject() vs NewObject()
Message
De
23/08/2007 19:08:35
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01249678
Message ID:
01250069
Vues:
32
>Mike,
>
>While I agree with using a factory et all, I still do not like SET CLASSLIB nor SET PROCEDURE, for their scope is always global, thus you will most likely end with lots of procedure and class libraries open than are no longer required.

Agreed, but they are part of the language. If much to my constant dismay you have two unrelated objects in a single vcx/prg you cannot release the classlib/procedure because the other class may still be open.

The factory may become a manager of the classlibs. To me I want the classes themselves, the classlib is an arbitrary container.

Furthermore, now your objects are no longer "Isolated", for they depend on this global settings, what would happen if you happen to have a class defined in more than one class library / procedure without you not even knowing about it (for example using a third party class library)

To a degree I suppose. The "isolation" you are talking about IMO is only to have the properties' values and methods isolated from other objects at runtime. In fact, I believe most people open all procedures and vcxs at startup, so that in effect they are also only using the classes.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform