Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Properly Reference Object in Heirarchy?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
How to Properly Reference Object in Heirarchy?
Divers
Thread ID:
00780585
Message ID:
00780585
Vues:
42
Hi

I am looking for suggestions from some people more experienced in OOP design than myself. The issue I am trying to resolve is how to properly get a reference to an object at the top of the container heirarchy. For example
Container
  BizObj
  CommandButton1
  PageFrame
    Page1
      Container
         Container
           CommandButton2
           CommandButton3
           List Box
    Page2
If I want to refer to the BizObj from CommandButton3 I have to do the following:

This.Parent.Parent.Parent.Parent.Parent.BizObj

If I later have to move CommandButton3 and this move changes the heirarchy I have to fix all the above references. I would prefer some other technique for accessing the BizObj that did not depend on the object heirarchy so that the code is more easily maintained.


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

Click here to load this message in the networking platform