[2191] in java-interest
Re: interfaces are NO substitution for method pointers
daemon@ATHENA.MIT.EDU (David Smyth)
Tue Sep 26 17:55:07 1995
Date: Tue, 26 Sep 95 12:06:36 PDT
From: dsmyth@mpfcmd1.jpl.nasa.gov (David Smyth)
To: java-interest@java.sun.com
Ken Arnold makes a very clear case, and I think he has convinced me:
In Java, one can re-use event generators (like buttons) by deriving
a class which contains the specific behavior we used to put in a
callback.
And I think I can imagine how an interface can also be used: some object
which takes events from an event source needs to implement an interface,
and that interface consists of what we usually call Callbacks.
And I agree with Ken, that this approach provides a significant improvement
in type safety. I always needed to implement, in code in the callback,
run-time type safety checks for "real" reliable applications, now I won't.
OK, I'm convinced, no need for pointers-to-functions (pointers-to-methods),
at least in this context.
______________________________________________________________________
| David E. Smyth David.E.Smyth@jpl.nasa.gov |_
| Mars Pathfinder Flight Software -- Object-Oriented Software for Mars | |
|______________________________________________________________________| |
| "It isn't exactly rocket science... well, I guess maybe it is..." | |
|______________________________________________________________________| |
|______________________________________________________________________|
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com