[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jonathan Rees on OO

1. PLT Scheme does support interfaces for classes. 
   Very useful. 

2. You also write: 

  "I always wished that interfaces could say more than just "here are all
   the methods, their names and type constraints".  I'd like for the
   definition of an output stream to assert that if write-character of 'a'
   on an object is followed, with no intervening operations, by a
   write-character of 'b', then that MUST have the same effect as a
   write-string of "ab".  Right now I can only say it in comments.  This
   kind of declarative constraint can make it easier to reason about
   programs sometimes."

   There are languages that support declarative (and not so declarative)
   assertions in interfaces and classes. Eiffel is one of them. There are
   also tools that support this kind of thing for Java (iContract (free),
   JMSAssert (.com)). 

   Surprisingly, they are all flawed and don't jive with the class/type
   hierarchy. If you're interested, check out Findler's work (OOPSLA '01, 
   FSE '01). 

-- Matthias