Tagged articles

Template Method Pattern

2 articles · Page 1 of 1
Lobster Programming
Lobster Programming
Oct 15, 2026 · Fundamentals

AQS Unveiled: State, CLH Queue, and Template Method in Java Concurrency

This article explains Java's AbstractQueuedSynchronizer (AQS) core model using a service counter analogy, detailing how the state variable and CLH queue manage thread synchronization, the template method pattern separating queuing logic from acquisition rules, and how LockSupport.park/unpark enable efficient thread blocking and waking, illustrated with ReentrantLock and CountDownLatch examples.

AQSAbstractQueuedSynchronizerCLH Queue
0 likes · 7 min read
AQS Unveiled: State, CLH Queue, and Template Method in Java Concurrency
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 9, 2026 · Backend Development

Refactoring 7 Duplicate Notification Services Using Template Method Pattern in Spring Boot

The article demonstrates how to correctly apply the DRY principle by refactoring seven duplicated notification service classes in Spring Boot 3.5.0 using the template method pattern and a NotificationMessage value object, consolidating 40 lines of repeated validation, logging, and error handling into a single abstract base class.

DRY PrincipleJavaNotification Service
0 likes · 12 min read
Refactoring 7 Duplicate Notification Services Using Template Method Pattern in Spring Boot