Can anyone let me know some example situations where Template Method - pattern should be used?
Give me some real-world use from your own experience.
(I have so far found it useful only for mapping data in the DA layer. Sorry!!!)
A Template method pattern provides a skeleton for performing any sort of algorithm or an operation, and it allows the sub-classes to re-define part of the logic.
Pros: Natural fit for building frameworks, so that parent framework classes can make callbacks into methods implemented in child.
Examples:
Cons: Restricts you to a single inheritance in Java.