The Artima Developer Community
Sponsored Link

Homogenous Families



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Homogenous Families

Posted by Bill Venners on 18 Jun 1998, 10:26 AM

> I agree that it's a good idea to subclass exception as the IOException exemple you give.
> The problem is that it is not possible to give some throwable interface.
> To fix the idea, it is impossible to have an IOException that is a RuntimeException at the same time.
> Sun should have create Runtime as a kind of Interface (idem for IOException in a sense).

I believe your point is that when I create a family of
exception types, it will have to be either a checked family
or an unchecked family. I can't mixed checked and unchecked
exceptions in the same family. That is true.

Seems like they could have made Unchecked an empty
interface that unchecked exceptions implement, instead
of relying on position in the single inheritance hierarchy.
But, things being the way they are, we'll have to live
with homogenous (either all checked or all unchecked) families.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us