[5862] in java-interest
Re: keyword to introduce a method?
daemon@ATHENA.MIT.EDU (Mike Afergan)
Thu Feb 29 22:44:27 1996
Date: Thu, 29 Feb 96 21:09:35 EST
To: garya@dreamchaser.org, strong-java@entmp.org
From: Mike Afergan <mikea@ai.mit.edu>
Cc: java-interest@java.sun.com
At 12:51 PM 2/29/96 -0700, garya@dreamchaser.org wrote:
>When writing a class, one could then use:
>
>public class Derived extends Base {
> intro public int foo() {...}
>}
>
>to indicate that the function is being introduced (i.e. is rooted at this
>node in the class hierarchy). It doesn't solve the problem, in the sense that
>the author of Derived still needs to deal with the name clash. However, it at
>least provides compile-time detection of the problem.
>
>Comments?
Admittedly your idea has some merit, but some flaws as well. First
of all, if the authors of Derived and Base are so distant as to not know of
eachother's work, the problem that you refer to would require the author of
Derived to somehow obtain each new version of Base, thereby giving him some
opportunity to learn of the changes made and at least giving him notice that
this problem may appear. If however, they were working together, this
problem (as you state) would not pop-up. Therefore, the only time that an
author will have absolutely no warning will be if he somehow has access to
the files of a person whom he doesn't deal with. While I admit that this is
very possible, it is a limited scenario. Furthermore in stating such, we
admit that any other author will have some form of notice that this problem
may appear. While some programmers may fail to take appropriate action and
institute appropriate checks, he nevertheless cannot complain that he had no
warning.
Furthermore, I couldn't help but notice that your "intro" modifier
concept would require that every method (I'm assuming you could apply it to
fields as well.) added to a class that has been available to other
programmers would require an "intro" modifier. Thus, after a few revisions,
virtually all methods would have an "intro" modifier, thus producing warning
messages all over the place - even if a programmer knew EXACTLY what he was
doing.
Without doubt, this is a sticky problem with no perfect solution -
except good code management and planning.
-- Mike
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com