What are "callbacks"? 
Author Message
 What are "callbacks"?


: What are "callbacks"?  I keep running into the term but I haven't been
: able to find a definition.

A programming idiom wherein a resource accepts from calling code
references to functions to be called when some resource event occurs.  The
function passed in, which is called by the resource when the event occurs,
is often refered to as a 'callback', as are the process of calling the
function, and the overall design model.

An example might be a GUI interface which would allow creation of an
onscreen widget; the call to create the widget would include a function
reference which would then be called whenever GUI events affecting the
widget occurred.

Object-oriented designs often hide the existence of callbacks 'under the
covers,' as the data associated with a resource is tightly coupled to the
methods of that resource.

Hope this helps!

---------------------------------------------------------------------

 --*--    Home Page: http://www.*-*-*.com/
   |      Member of The HTML Writers Guild: http://www.*-*-*.com/ ;
       "Every man and every woman is a star."



Fri, 22 Dec 2000 03:00:00 GMT  
 What are "callbacks"?

Quote:

>: What are "callbacks"?  I keep running into the term but I haven't been
>: able to find a definition.

>A programming idiom wherein a resource accepts from calling code
>references to functions to be called when some resource event occurs.  The
>function passed in, which is called by the resource when the event occurs,
>is often refered to as a 'callback', as are the process of calling the
>function, and the overall design model.

>An example might be a GUI interface which would allow creation of an

A simpler example, IMHO, is the sort command in Perl.  The second
parameter is the name of a subroutine that the user supplies,
which sort "calls back" to do the comparision.


Sun, 24 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am an "antispam spammer"?

2. "character class ""bug""

3. system(("cp", "-Rf", "/tmp/a/*", "/tmp/b")); doesnt wrk

4. how to parse a "this", "that", "and the ", "other" file

5. s"\n+$"" s"\n*$""

6. how to safely substitute a "(", ")" or "["

7. "perlfreak", "i love perl", "perllover" or...???

8. how to parse "this", "that", "other"

9. split line like "a","b","c"

10. Looking for a Solaris "quot" replacement

11. Menubutton callback, what am I doing wrong here?

12. How to "$block_of_text<<"EOT" while "use strict"?

 

 
Powered by phpBB® Forum Software