Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can anybody explain what is callback method?

 
Anna Wang
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everyone,

In HFSJ ch13 Q1:

Which are true about filters?

B. The destroy methos is always a container callback method.
C. The doFilter method is always a container callback method.

Answer B is right.

Can anybody explain this answer and what is callback method?

Thank you so very much.

Anna
 
Anbu Rajendran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term callback method means the same as in normal conversations.

If I meet someone and want them to contact me, I will give them
my phone number. This is known as my callback number.

Similarly, when a container starts up a filter says to the container
that it is a filter and that it can be contacted by calling the
doFilter method. Since every filter has a doFilter method [required
by the interface] doFilter is called a callback method.

You could say that doGet is a callback method for servlets.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way of thinking of it is simply that callback methods are methods you never call in your code. They are the methods only the container should ever call.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ ch13 Q1:

Which are true about filters?

B. The destroy methos is always a container callback method.
C. The doFilter method is always a container callback method.

Answer B is right.

As per Marc Peabody,

Another way of thinking of it is simply that callback methods are methods you never call in your code. They are the methods only the container should ever call.

so, both B,C are correct as per Marcs statement.

Please give a complete explanation on the above question.
also, whtat is a inline method ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic