good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
An object oriented principial dilema arises from such redundancy - should the child object be responsible for it's location in the parent (knowing and/or maintaining)?
Some will argue that since the children heriarchly exist within the parent, then the responsibility should only be the parent's... This is perhaps analogeous to the question of wether you should use method objects within sibling methods, or access the object internals directly. Think about it. In addition, perhaps Tie::RefHash may be of use for maintaing a hash of references to the child objects, within the parent. The parent can simply lookup child by it's object reference, and in the hash will be the coordinate values. -nuffin zz zZ Z Z #!perl In reply to Re: Re: Re: Child objects querying parent objects about themselves
by nothingmuch
|
|