Peter Scott wrote:
> What's wrong with multiple inheritance?

You have to create a whole load of extra classes whose only
purpose is to define a list of superclasses. Compare:


  bless $self, qw(Employed Male);

with

  package Employed_Male;
  @ISA=qw(Employed Male); # multiple inheritance
  ...
  bless $self, "Employed_Male";


Allowing C<bless> and C<ref> to use lists allows me to be
slightly more Lazy. In bigger hierarchies, the benefits are
greater because the number of possible leaf classes is
greater. (Imagine Employed as subclasses of FullTime and
PartTime; then add in race, ethnicity, ...) Some people
would argue that these things are attributes, not base
classes; but those same people would argue that multiple
inheritance is bad. I'm not objecting to multiple
inheritance: I just saying that its a waste of effort
to create classes that don't add any new details.

If the class that combines multiple superclasses adds
unique behaviour/data to that combination, then multiple
inheritance is the correct solution. When all you are doing
is saying that an object has 2 classes then forcing the
extra work is just a waste of time.

Dave.

Reply via email to