From: Paul Brannan Date: 2002-10-18T04:26:42+09:00 Subject: Re: Interfaces in Ruby On Fri, Oct 18, 2002 at 03:02:53AM +0900, Chris Gehlker wrote: > > What would keep you from turning your cluster base class into a Module, > > and using it as a mixin? > > Because the 'is a' relationship is going the opposite direction. I use > Modules in Ruby where I would use MI in C++ and cluster bases where I > would use virtual classes. That way I have a nice clean inheritance > tree. module Foo1 end class Bar1 include Foo1 end b = Bar1.new p b.is_a?(Foo1) #=> true class Foo2 end class Bar2 < Foo2 end b = Bar2.new p b.is_a?(Foo2) #=> true The "is a" relationship looks to me like it's going the same direction in both cases. Paul