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


in reply to Re: Re: Often Overlooked OO Programming Guidelines
in thread Often Overlooked OO Programming Guidelines

Most of the times I prefer delegation. It is a useful technique, because it is really easy to reuse modules that way. But it depends on your programming style. I usually write small modules, which have one or two functions. I have for example a module Logging, which does exactly that: 'Logging'. I use delegation to build with them. For example I can put them in a facade, which does some more complex things.
Inheritance I mostly use, when I want some method to be shared by all my objects.
  • Comment on Re^3: Often Overlooked OO Programming Guidelines