Skip to content

Glossary: Software Design Patterns in Java

Template method

Also written: template method pattern

A pattern that fixes a job's steps in one place and leaves one step, the hook, for the caller to supply as a lambda or in a subclass. Try-with-resources is an example in Java.

Where the book teaches it

Related terms

HookAbstract classTry-with-resources