[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: Interfaces in Ruby
From: Paul Brannan <pbrannan () atdesk ! com>
Date: 2002-10-18 17:01:19
[Download RAW message or body]
On Fri, Oct 18, 2002 at 11:21:17PM +0900, Chris Gehlker wrote:
> I consider mixins to be a *form* of MI. I would go so far as to say
> that it is the only form that I've actually seen usefully employed even
> in C++ code. Your example below and your previous example with is_a
> show that it passes the duck test. But even if you want to consider the
> it to be "the illusion of multiple inheritance" it's important to
> maintain the illusion. Which is why I think it important to use class
> clusters as well as mix-ins.
I think it's possible to maintain this illusion, provided:
1) No two modules mixed into the same class provide two methods with
the same name
2) Mixins do not carry any state (and therefore have no initialize()
method); this is a special case of the first requirement.
I have not yet decided whether I think it is always a good idea to
strictly adhere to these requirements.
Paul
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic