Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
(OOP) Part Time Composite Objects?
Message
De
27/08/2003 10:54:09
 
 
À
26/08/2003 16:50:35
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00822766
Message ID:
00823781
Vues:
28
>Chris,
>Don't know how far you've gotten in your access method, but...
>
>It's the "child" object created in GetBizObject() that has an lCreatedNewInstance property added.
>
>This was done so you can check during Destroy() to determine whether the "child" object was created merely as a function of the containing object's needs or was instantiated "in its own right." This way, you know whether to Release() it vs. just setting the object property to .NULL.

That sounds like exactly what I was looking for. Need to read more about it.

>We got together with Kevin on this one at some point over the past couple years to solve both the problem you mention and address some dangling reference issues we were muddling through.

Anything about that you can share? I'm having similar issues while debugging.

>I would be interested to see what you did in your access method, though, when you've finished it.
Function MyObject_access()
IF NOT ISNULL(This.MyObject)
 This.MyObject = CreateObject("MyObject")
ENDIF
RETURN This.MyObject
This way I can call child object functions without adding the createobject() code to every call. I'm unconditionally NULLing the MyChildObject reference in Destroy(), which should free the reference if it was pre-existing, and nuke the object if it was newly created.

I'm going to have to look into GetBizObject again, no need to reinvent the wheel. I think the only thing holding me back is being able to address the child object by name in code.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform