Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection Class Problem
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Collection Class Problem
Divers
Thread ID:
00853474
Message ID:
00853474
Vues:
45
Hi

I have been using a collection class for managing my cursor adapters. I often have code like:

This.obizObj.collection("myCA").MyMethod

This allows me to avoid using macros like the following:

This.oBizObj.&myCA.MyMethod

However, objects added to collection do not have a parent object reference so there is no way to reference objects in the heirarchy unless you specify an additional property of the cursor adapter to hold a parent object reference. However if you do this you will have the problem of circular object references which you must manage or you will have dangling object references.

I could use the macro method but it requires that I use the AddObject method to add the Cursor adapters to the business object. However, there are times when the cursor adapter object may already exist and so it does not need to be created which means I cannot use the AddObject Method in that case.

At present I have just created a property in my cursoradapter class where I store a reference to the business object and manage the garbage collection manually.

I wondered what other solutions people have developed for this type of scenario.

Thanks
Simon
Simon White
dCipher Computing
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform