Tuesday, October 2, 2007

Example of Template Method Pattern

The template method pattern is a commonly used pattern that is very useful when you want a class or program to follow a certain guideline, but don't want it to be tied down to a specific behavior. I am currently taking a web applications class with Dr. Toal, and have discovered (with the help of Dondi) that the spring framework contains an example of the template method pattern. Within the spring framework, there are several abstract controller classes which act as templates. A specific example is the AbstractController, which serves as a superclass that provides functionality for sublcasses to use, as well as abstract template methods for subclasses to override and implement themselves.

1 comment:

Dondi said...

Be precise with your pattern names...it's template method, not just "template."