Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Is an actionListener a callback?

Reply
Thread Tools

Is an actionListener a callback?

 
 
jmDesktop
Guest
Posts: n/a
 
      05-24-2008
I'm just trying to understand what a callback is. I read it is a
listener, but not sure. I have searched. Thank you for any help.
 
Reply With Quote
 
 
 
 
Daniele Futtorovic
Guest
Posts: n/a
 
      05-24-2008
On 2008-05-24 06:21 +0100, jmDesktop allegedly wrote:
> I'm just trying to understand what a callback is. I read it is a
> listener, but not sure. I have searched. Thank you for any help.


Pretty much. All listener can be seen as delayed callbacks.

In languages where you can have function pointers, you'd typically pass
such a pointer to a function to be used as a callback. In Java, you'll
declare the function to take a specific interface, and pass the function
an implementation of that interface. Since Java sports anonymous
classes, the process is only slightly more complicated and does
lead, in my humble opinion, to more structured and clean code than if
you could use function pointers.

--
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"
 
Reply With Quote
 
 
 
 
Stefan Ram
Guest
Posts: n/a
 
      05-24-2008
jmDesktop <(E-Mail Removed)> writes:
>I'm just trying to understand what a callback is.


»Callback« is not a concept of the Java Language
Specification, Third Edition.

A »callback« is a callable entity that is passed
to another entity, so that this other entity might
call it (back).

 
Reply With Quote
 
jmDesktop
Guest
Posts: n/a
 
      05-24-2008
On May 24, 12:27*am, "Peter Duniho" <(E-Mail Removed)>
wrote:
> On Fri, 23 May 2008 21:21:37 -0700, jmDesktop <(E-Mail Removed)> *
> wrote:
>
> > I'm just trying to understand what a callback is. *I read it is a
> > listener, but not sure. *I have searched. *Thank you for any help.

>
> It depends on your definition of "callback". *In my experience, that's *
> reserved for describing a function point of sorts, which Java doesn't have..
>
> But Java does use interfaces to accomplish much the same functionality. *
> In that respect, actionListener (and the numerous other similar "listener" *
> interfaces) could be thought of as a "callback".
>
> What's the context? *Where are you seeing the term "callback", and is *
> there something about how it's used that you don't understand and you're *
> trying to figure out?
>
> Pete


Just in general. Nothing specific. I hate reading computer books
where they expect one to know exactly what their talking about, when
they should not suppose it. I was reading something on oop and the
author starting talking about callbacks. It was a beginner book and I
just have never really got the concept. Then I read something that
said a Java listener was a callback, which kind of cleared things up.
I can never get straight who the caller and the callee is. thanks.
 
Reply With Quote
 
Daniele Futtorovic
Guest
Posts: n/a
 
      05-24-2008
On 2008-05-24 18:58 +0100, jmDesktop allegedly wrote:
> Just in general. Nothing specific. I hate reading computer books
> where they expect one to know exactly what their talking about, when
> they should not suppose it.


Sounds like you need the reference work on this subject: "How to read
computer books in forty-two days", by Ron Obvious and O.W.A. Giveaway,
Aintsinno Books, Palermo, 2001.

--
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
actionlistener....Cannot use this in a static context 6e Java 1 07-15-2005 11:00 PM
ActionListener and ItemListener Jenny Java 1 08-09-2004 02:59 PM
Identifying the source of event when using ActionListener Michael Java 6 07-11-2004 11:01 AM
Custom actionListener on a Rectangle2D.Double Chris Lawson Java 2 02-05-2004 05:34 AM
ActionListener Clive Moore Java 2 12-03-2003 09:27 AM



Advertisments