what is tempplate pattern

Answer Posted / srinu

A java method that is capable of calling set of methods in a
sequence to completd task is called template method

EX:-
public void xyz()
{
x();
y();
Z();
}
Best Example for template design pattern for in struts
framework org.apache.struts.action.RequestProcessor
class follow Template Design pattern. In RequestProcessor
class nearly 16 no.or processXXX() methods are their These
methods are exceuting sequence thats way this method is
called Template method.
RequestPrcocessor calls cretes/locates formbean
class object and calls Reset(),validate() methods in
formbean class and calls execute()in Action class.This takes
Application contrlloer for frontcontroller servlet of Action
class

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does sprintf mean?

525


What is unicode datatype?

521


What is linkedlist in java?

500


Why does java does not support multiple inheritance? Explain

545


Tell us something about an iterator.

544






In a class implementing an interface, can we change the value of any variable defined in the interface?

551


What does flag mean in java?

537


What does || mean in code?

538


What is integers and example?

486


What is the difference between a constructor and a method?

562


What are the types of collections in java?

535


What is return in java?

548


how to one war file class to another war file class?

1552


What is a databasemetadata?

541


how would you implement a thread pool? : Java thread

500