Album Cover

Design Patterns Vol. 1 Java

Close Preview
The Players
This pattern brings the following players to the stage:
  • Template Method: A recipe or set of steps that declares what gets done.
  • Skeleton: The class containing the Template Method.
  • Filler: A Skeleton subclass that fills in one or more Template Method steps.
Template Method Steps
A Template Method is typically composed of the following kinds of steps:
Hook MethodA method in the Skeleton with default or do nothing behavior that Fillers may override.
Mandate MethodA method that Fillers must provide.
Helper MethodA method in the Skeleton that is used by the Template Method.
Factory MethodA method that creates an object the precise type of which is determined by Fillers.
Ah, so the Template Method defines the skeleton, and the subclasses put the meat on the bones...
| Tweet...
Page rating: | Rate this Page