Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing a parent's object
Message
From
27/08/2007 17:32:30
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01250681
Message ID:
01250780
Views:
19
>>>>Just had a thought. What about using AddObject (or something like that) in the oxServer that creates the oHandler object, instead of passing it in? Or is that like having two mirrors facing one another?
>>>>
>>>You mean something like
>>>oxHandler = CREATEOBJECT( "EMPS_Handler_Medinotes_Class" )
>>>oxServer = CREATEOBJECT( "EMPS_Server_Class",m.Port,oxHandler )
>>>oxServer.oxHandler.addproperty('oxServer',this)
>>>
>>>I don't know if this is "proper" design, but you would wind up with each object having a reference to the other.
>>
>>No, just have:
>>
>>oxServer = CREATEOBJECT( "EMPS_Server_Class",m.Port)
>>
>>Then inside the oxServer definition, have this:
>>
>>oxHandler = CREATEOBJECT( "EMPS_Handler_Medinotes_Class" )
>>
>>Wouldn't that create the object oxHandler as a child of oxServer? Same thing I'm doing when I pass it, but now it will have the proper parent relationship because it was created with oxServer instead of before.
>
>No unless you do it like
>
>this.oxHandler = CREATEOBJECT( "EMPS_Handler_Medinotes_Class" )

Ok, syntax aside, that would be a logical approach to this, right?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform