Tagged articles

Hook Method

3 articles · Page 1 of 1
Dabaoshi
Dabaoshi
Aug 9, 2026 · Fundamentals

Template Method Pattern: Fix the Skeleton, Vary the Steps

The article explains the Template Method design pattern, showing how to lock a fixed process skeleton in a parent class while delegating variable steps to subclasses, contrasting it with the Strategy pattern and illustrating its use in real‑world frameworks.

Design PatternFinalHook Method
0 likes · 14 min read
Template Method Pattern: Fix the Skeleton, Vary the Steps
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 9, 2020 · Fundamentals

Understanding the Template Method Design Pattern with Java Examples

This article explains the Template Method design pattern, illustrating its structure with Java code examples—including an abstract Drinks class, concrete Tea and Coffee subclasses, hook methods, and real‑world usages in JDK sorting and Spring's application context—while highlighting advantages, drawbacks, and typical scenarios.

Design PatternHook MethodJava
0 likes · 12 min read
Understanding the Template Method Design Pattern with Java Examples