Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing Object Reference among COM Objects
Message
 
To
16/01/2002 22:06:56
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00605886
Message ID:
00605888
Views:
28
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform