[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Interfaces in Ruby
From:       "Jason Voegele" <jason () jvoegele ! com>
Date:       2002-10-18 13:55:15
[Download RAW message or body]

Paul Brannan wrote:
> On Fri, Oct 18, 2002 at 08:13:18PM +0900, Massimiliano Mirra wrote:
>> Second, is certifying a behaviour really a class's responsibility?
>
> The intent of an interface is not to cerfity a particular behavior.  It
> is to certify that the author's intent is for the class to have a
> particular behavior.

This is true of Java interfaces, but Design By Contract does make
certifying a particular behavior a class' responsibility, which is why I
think it's a misnomer for the Java literature to refer to interfaces as
contracts.  It's like a business contract that only lists the names of the
parties involved and doesn't state their obligations and benefits.

"Some day" I'm going to have to create an experimental language that,
going one step beyond Eiffel, reifies contracts and makes them first-class
language citizens.  Perhaps Ruby's metaprogramming facilities would be
enough to toy around with this idea.  If not, it could probably be done in
Lisp.

-- 
Jason Voegele
"We believe that we invent symbols. The truth is that they invent us."
    -- Gene Wolfe, The Book of the New Sun



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic