This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

callback and template

 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone explain what is meant by callback and template. What are the difference between then. Actually I googled both term but I got lot of explaination that make me confused. So anyone just share your views?
 
Joseph Macer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The words "callback" and "template" given to us without any context can mean a variety of things, as indicated by the related Wikipedia articles:
http://en.wikipedia.org/wiki/Callback_(computer_science)
http://en.wikipedia.org/wiki/Template_(programming)

Without explaining what the context - information surrounding the words - we can't really help you. Here are some general questions that might help us, help you:

What were you reading when you ran into these words?
Can you provide relevant sentences containing these words?
Did you check the glossary or index for whatever you were reading?
 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
spring framework uses Template and callback for database operation .In ejb also I heard callback method.when I google I got definition that callback are used to pass method as parameter into a method.Hope I give the some additional information
 
Campbell Ritchie
Sheriff
Posts: 48394
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too complicated a question for the beginners' forum. Moving.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both Callback and template are kind of design patterns which are very different from each other, so explaining the difference between them is of not much relevance.

Callbacks are usually used by frameworks when the framework code wants to inform a component that "something" has occurred. eg: In ejb you will have methods like ejbActivate() and ejbPassivate() which tells the EJB that activation/passivation is hapening, do what you want to do now. Otherwise, the EJB will not have any idea when activation/passivation happens and can not do anything that it would have wanted to do during those activities.

Template is a gang of four design pattern as described here
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitesh Kant wrote:
Template is a gang of four design pattern as described here


That's "Template *Method*". "Template" is a much more generic term.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilja Preuss wrote:
Nitesh Kant wrote:
Template is a gang of four design pattern as described here


That's "Template *Method*". "Template" is a much more generic term.


Oops ... thanks Ilja for the correction
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic