On Sun, Nov 4, 2012 at 12:49 PM, Ross Konsolebox <lists / ruby-forum.com>wrote:

> Arlen Cuss wrote in post #1082618:
> > I think I can say "no" with a fair amount of confidence.
> >
> > Single-inheritance is considered a good thing (and MI has many
> > pitfalls), too: http://www.artima.com/intv/tuesday2.html
>
> Thanks for the reply. The information is adequate. It's quite
> disappointing though since because of that we tend to use class-module
> pair format just to make class ready for multiple-inheritance by mixins
> through its module; or else we always had to rewrite an existing class
> or transfer its contents to a module or the inheriting class itself
> every time we make use of the features.
>

If you notice you do this regularly you are probably doing something wrong
with regard to Ruby's OOP.  It looks as if you want to carry over your
inheritance scheme from language X (C++, Eiffel...).  If something is an
entity (class) _and_ a set of functionality used in various places (module)
at the same time then maybe you do not separate the two clear enough.  For
example, you might notice that your reported 1:1 relationship between class
and module should rather be a 1:4 relationship (i.e. an entity being built
from various functionalities).  Or maybe you are using inheritance where
you should rather use composition.  All that could of course be discussed
much better with a concrete example of your code... :-)


> I believe MI is not that evil and its potential is the one that's more
> to consider or look upon. Some languages also had their ways with
> dealing with those problems:
> https://en.wikipedia.org/wiki/Multiple_inheritance.
>
> I honestly think that Ruby would have been more enjoyable if it had
> supported pure multiple inheritance.
>

For me absence of class MI does not take anything away from the fun and I
can't imagine how it could be more fun with class MI.  I tend to believe
though that inheritance is generally overrated.  For me encapsulation is a
much more important concept in OOP than inheritance.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/