Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateObject() vs NewObject()
Message
De
23/08/2007 20:36:21
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:
01250077
Vues:
22
Here's another thing that often bugs me.

If you never knew about createobject or newobject or whatever, and all I ever showed you was how to use a factory object, would you need to know about createobject or newobject? Do we teach children to use lego blocks by first explaining plastic injection molding?

I mean why do we insist on teaching people to crawl when they are adult enough, intelligent enough to walk?



>>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.
>
>Actually, you can never release a classlib/procedure once it's open, for you do not know if an object still requires it or will require it
>
>>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.
>
>I agree, but one bad behaving object can cause havoc in the flock, just by closing a library/procedure file or just by forgetting to add one keyword (additive). This of course can be minimized by the use of standards, for example as you say opening all of them at the begining and never closing them, but again, you might get bite by some third party class and finding the culprit might not be as easy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform