[4412] in java-interest
Re: interfaces
daemon@ATHENA.MIT.EDU (Ken Arnold - Sun Labs)
Fri Dec 22 12:35:10 1995
Date: Fri, 22 Dec 1995 10:40:50 -0500
From: arnold@suneast.East.Sun.COM (Ken Arnold - Sun Labs)
To: java-interest@webrunner.neato.org
I don't disagree with you, but I find it hard to argue that it is
*wrong* to say "class A implements B", where B is a class to be treated
*as* *if* it was declared as an interface. All fields (except static
final ones) would be ignored, and all non-public methods would be
ignored, and all method implementations would be ignored.
I am not, however, so enamored of the idea that I am advocating it,
either.
If Bar and Groo both have a method foo(), you can implement both only
if you can provide a definition that is compatible with both. If the
number of type of parameters is different, you're set. If the number
and types of parameters are polymorphicly assignable, and the return
types are the same, and the throws clauses can be ordered so that one
is a subset of the other, you can provide a least-common-denomintor
implementation. Otherwise you are screwed in the way you describe. I
don't think that anyone is currently very excited about solving this
problem, amid all the other issues that need to be addressed, but if
you have a good solution, you should submit it as an RFP so that it can
be considered.
Ken
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com