Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Properly Reference Object in Heirarchy?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
How to Properly Reference Object in Heirarchy?
Miscellaneous
Thread ID:
00780585
Message ID:
00780585
Views:
44
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
Next
Reply
Map
View

Click here to load this message in the networking platform