From: Robert Klemme Date: 2012-11-05T21:34:07+09:00 Subject: Re: Support for multiple Inheritance by classes --f46d04462ca8830d4b04cdbeb361 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Nov 4, 2012 at 12:49 PM, Ross Konsolebox 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/ --f46d04462ca8830d4b04cdbeb361 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Sun, N= ov 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 not= ice you do this regularly you are probably doing something wrong with regar= d to Ruby's OOP.=A0 It looks as if you want to carry over your inherita= nce scheme from language X (C++, Eiffel...).=A0 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.=A0 For examp= le, 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).=A0 Or maybe you are using inheritance where you = should rather use composition.=A0 All that could of course be discussed muc= h better with a concrete example of your code... :-)
=A0
I believe MI is not that evil and its potential is the one that's more<= br> 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 absen= ce of class MI does not take anything away from the fun and I can't ima= gine how it could be more fun with class MI.=A0 I tend to believe though th= at inheritance is generally overrated.=A0 For me encapsulation is a much mo= re important concept in OOP than inheritance.

Kind regards

robert

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