On Sep 21, 2005, at 9:23 AM, Josh Charles wrote:

> On 9/21/05, Gavin Kistner <gavin / refinery.com> wrote:
>
>> If you really want multi-inheritance, you should ask yourself "Why do
>> I want this?"
>>
>> Then you should tell us, so that we can show you how the same goals
>> can be achieved, simply, in Ruby. :)
>>
>
> One place multiple inheritance / interfaces really shines is with
> adapters and the observer pattern.  I've not tried either of these
> with ruby yet, however, so I'm unfamiliar with how these problems
> would be solved with ruby.
>
> Adapter: you have a common interface for accessing the database, so
> that if the database changes, you just change the adapter, and nothing
> else changes.

You're still thinking like a Java programmer here.  Us Rubyists are  
big believers in Duck Typing.
The saying goes, "If it walks like a duck and talks like a duck, it's  
a duck."  In other words, if it supports the method calls we want,  
we're happy.  We generally don't even check for the methods.  If it's  
not there, an exception will be thrown.

The hint earlier given to post some code and let us Rubyify it was a  
good suggestion.  You just need to get into the Ruby mind set.  Free  
your mind.  ;)

> Observer: the ability to update several objects when one main object
> changes state.  The observers are usually registered with the main
> object.  These observers could possibly be several different types of
> data structures, but the main object requires a certain interface in
> order to insure that the observer is updated.

See the standard "observer" library.

James Edward Gray II