Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference To the Highest Level Container
Message
De
27/03/2003 18:31:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00769815
Message ID:
00771086
Vues:
13
>At present I have decided to create a property for my application object that will contain a reference to the highest level container for active object.

Are you sure this is a workable solution? It sounds like you're planning to store a single object reference as an app-level property. But how do you maintain this setting? You could easily have many objects in use from many different containerships. How do you ensure that the one you're interested in is the one that is currently stored in the app object?

I don't believe there are any magic shortcuts for this. In once case when this need arose, I added a property to the objects of interest, and used an _access method to walk up the containership looking for the ultimate parent. This presents a dilemma though: either repeat the walk every time you need the reference (thus incurring a performance hit) or store the value in the object property the first time you find it (this creating a garbage-collection issue that you must watch closely).

-- Randy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform