Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing Object Reference among COM Objects
Message
 
À
16/01/2002 22:06:56
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00605886
Message ID:
00605888
Vues:
27
>Suppose I have several business COM objects that use the same class to perform data services. Is there a way to create the object once and share it among the various business objects? I could set a property on the business object after I instantiate it, but then it wouldn't be stateless. I really don't want to pass the reference in as a parameter to every method. Does anyone do this, or is it typical to create a new data object for each business object? That seems like a waste.
>
>Thanks.


From what you say, I would create a new instance for each business object.

You are able to create it once, then assign it to each of the objects as properties, but then you loose some of the encaspsulation (ie the object is relying on another process to set it up correctly)

I dont think it is much overhead to just create a new property, and on init create the object and assign it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform