Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Object Oriented Programming
I've gotten the impression from others that it is important to create some objects while in the INIT of other objects to (supposedly) contain them and maintain a parent/child relationship. I have tried this, and though the second object appears as an element of the first object, there is no value in the .Parent property.
As I said before, it does not matter where you create an object, but how. This is the fundamental difference between aggregation (where there is no parent/child releationship and one object merely holds a reference to another object) and composition ( where the is a parent/child relationship between the objects ).
So, oRef is created as an object of THIS? THIS is another object, but oRef has no .Parent? How to get a value of a property of THIS from a procedure contained in oRef?
No - oRef has an independent existence and "This" holds a reference to it. There is no parent/child relationship here.
You can pass in parameters to oRef's Init() and let oRef process them. Or you can set some of oRef's properties after instantiating it.
I was wondering about that. Currently when I quit my program, I still have to Remove reference from memory before I can edit my PRG.
In the destroy of the object that is holding the reference to oRef, RELEASE it and for good measure, set it to .NULL.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only