XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
as I said, there is legacy code which is using Method Chaining (I didn't design it)
$house->get_member("Willy)->clean_house(); Now the model changed and Person "Willy" can be member of different households > I have never actually run into a case where an element needed to know its container I have no idea how method chaining would be implemented else, since ->clean_house() is referring to $house In the new model case ->get_member() can't return a Person object anymore One possibility discussed here is to return a Wrapper-Object Inhabitant ° which wraps the relation 'Person ->belongs_ to-> House' and delegates accordingly.
Cheers Rolf °) update s/Member/Inhabitant/ for consistency to previous posts
UPDATEregarding your suggestion, see Re^3: OO Pattern Container x Elements and Method Chaining
In reply to Re^3: OO Pattern Container x Elements and Method Chaining (House, Person, Inhabitant)
by LanX
|
|