http://www.perlmonks.org?node_id=996028


in reply to Altering the inheritance path of an object

If you're wanting to alter the behavior of individual instances then you may be interested in strategy pattern. You'd have different classes implementing the different behaviors and then your original objects would have a reference to (possibly singleton) instances of the corresponding strategy implementors as appropriate.

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re: Altering the inheritance path of an object