[2121] in java-interest

home help back first fref pref prev next nref lref last post

Re: interfaces are NO substitution for method pointers

daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Mon Sep 25 21:41:26 1995

Date: Mon, 25 Sep 1995 16:31:44 -0800 (PDT)
From: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
Reply-To: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
To: Jonathan Payne <jpayne@starwave.com>
Cc: java-interest@java.Eng.Sun.COM



> OR, somebody please tell me why I am confused.
> 
> It has been suggested that using interfaces is a substitution for
> method pointers.  How's that?  How would I implement EMACS keymaps
> using interfaces?  Or, if not interfaces, a class with an action
> method, that you subclass for each callback.
> 
> I would have to create N classes for each entry in an Emacs keymap
> that runs a difference command.  I really don't want to create N
> classes for N callbacks, especially when EACH OF those callbacks
> REALLY wants to be executing in the context of another class (say, the
> EditorBuffer class).  No thanks.  I want method pointers.
> 
> Is there a security issue that I am not understanding?
> 
> Regardless of whether Java is going to have method pointers some time
> in the future, please don't tell me that interfaces or "action"
> classes are a good substitution.  That's ludicrous.

I don't think it is ludicrous, interfaces are strongly typed sets of methods. 
Anyway, there seems to be no point in trying to convince you so I won't.

Have fun,

	Arthur van Hoff

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post