aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes callback and template Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "callback and template" Watch "callback and template" New topic
Author

callback and template

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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

Joined: Apr 20, 2008
Posts: 63
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

Joined: Apr 02, 2008
Posts: 576
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

Joined: Oct 13, 2005
Posts: 38844
    
  23
Too complicated a question for the beginners' forum. Moving.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

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


apigee, a better way to API!
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: callback and template