in reply to Re: Instance data inheritance?
in thread Instance data inheritance?
If you have a case where MyClass::Item ISA MyClass, then you can rebless the object into the subclass. I'm using that technique right now on a project.I must say that I had thought of using "real inheritance" by cloning the "parent instance" data (or some relevant portion of it) into the child objects - however it seeemed to me to be totally unacceptable in terms of data payload.
Now that you point it out, reblessing doesn't seem to be affected by this downside, yet I'm slightly concerned about it, from the conceptual poin of view since it conveys the impression of including data into the "item" objects that really doesn't belong to them (but they must have access to it).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Instance data inheritance?
by herveus (Prior) on May 17, 2005 at 10:40 UTC | |
by blazar (Canon) on May 17, 2005 at 14:04 UTC |