[PRL] IOP and disjoint unions

Richard Cobbe cobbe at ccs.neu.edu
Thu Apr 28 17:19:44 EDT 2005


On Thu, Apr 28, 2005 at 04:46:42PM -0400, William D Clinger wrote:
> Richard asked:
> > How does this differ from, for example, Java's instanceof and checked
> > cast operations?
> 
> Java's instanceof and checked cast operations expose the
> class/interface inheritance hierarchy, reducing representation
> independence.
> 
> The code I wrote is structure-shy: it exposes none of that
> hierarchy.

Interesting.  Given that Honu separates subtyping and subclassing, the
instanceof and cast operations expose only the subtyping hierarchy, not
the subclassing one.

Under those circumstances, would you still regard the use of casts as
exposing too much of the representation?  

One could argue that, with IOP's identification of interfaces and types,
the subtyping hierarchy is an important part of the interface
specification, so it's already exposed.  (In fact, I suspect we will
argue just that, although I haven't really thought about this particular
issue very much yet.)

Richard



More information about the PRL mailing list