in reply to Proper way to call subclass methods?
With inheritance, there's no need to wrap the FFMech object in an EventRepository object - each EventRepository object already is a FFMech object, too.
The gets method seems to belong to EventRepository, not to FFMech: the nested _mech doesn't exist in the former class. With delegation, you'd define a get method in the FFMech class that would call $self->{_mech}->get, and in the EventRepository, you'd do the same: but its get would call FFMech's get, which in turn would call the original 'get'.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Proper way to call subclass methods?
by nysus (Parson) on Mar 08, 2016 at 16:57 UTC |