Tag

DesignPattern

1 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Jan 23, 2024 · Backend Development

Design and Implementation of a Local Cache Component in Spring Boot

This article explains how to build a robust, thread‑safe local cache for Spring Boot applications by defining cache domain models, abstract managers, a centralized registry, and scheduled refresh tasks, while providing complete Java code examples and best‑practice recommendations.

CacheConcurrentHashMapDesignPattern
0 likes · 23 min read
Design and Implementation of a Local Cache Component in Spring Boot
Top Architecture Tech Stack
Top Architecture Tech Stack
Oct 13, 2023 · Fundamentals

Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations

This article explains several common Java singleton implementations—including lazy ("hungry"), eager, double‑checked locking, holder, and enum patterns—detailing their code, thread‑safety characteristics, performance trade‑offs, and pitfalls such as partial initialization and reflection attacks.

DesignPatternJavaLazyInitialization
0 likes · 10 min read
Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations
Architect
Architect
Oct 8, 2023 · Backend Development

Deep Dive into OkHttp: Core Principles, Interceptor Chain, and Practical Usage

This article provides a comprehensive analysis of OkHttp’s source code, explaining its request‑execution flow, layered architecture, interceptor chain design, and demonstrates how to implement custom interceptors for unified request handling in Java and Android projects.

AndroidDesignPatternInterceptor
0 likes · 15 min read
Deep Dive into OkHttp: Core Principles, Interceptor Chain, and Practical Usage
Top Architect
Top Architect
Aug 29, 2020 · Backend Development

Replacing If‑Else with Enum‑Based Channel Rules in Java

This article demonstrates how to refactor channel‑specific processing logic in Java by introducing an abstract rule class, concrete channel rule implementations, and an enum that binds channel identifiers to their rule objects, thereby eliminating cumbersome if‑else statements and adhering to the open/closed principle.

CodeExampleDesignPatternJava
0 likes · 5 min read
Replacing If‑Else with Enum‑Based Channel Rules in Java
Selected Java Interview Questions
Selected Java Interview Questions
Apr 17, 2020 · Backend Development

Understanding Java Thread Pools: Benefits, Detailed Parameters, and Singleton Implementation

This article explains the advantages of Java thread pools, breaks down the ThreadPoolExecutor parameters and execution flow, compares common pool types, and demonstrates how to implement a thread‑pool as a singleton to efficiently manage concurrency in backend applications.

DesignPatternJavabackend
0 likes · 10 min read
Understanding Java Thread Pools: Benefits, Detailed Parameters, and Singleton Implementation
Java Captain
Java Captain
Jan 5, 2019 · Fundamentals

Avoiding NullPointerException with the Null Object Pattern and Optional in Java

This article explains the "null‑check disaster" in Java, introduces the Null Object design pattern with full code examples, presents the NR Null Object IntelliJ plugin for automatic generation, and demonstrates how Java 8 Optional and Kotlin safe‑call operators can provide cleaner, null‑safe alternatives.

DesignPatternJavaNullObject
0 likes · 9 min read
Avoiding NullPointerException with the Null Object Pattern and Optional in Java
Java Captain
Java Captain
Mar 25, 2018 · Fundamentals

Understanding Java Callback Mechanism Through a Classroom Analogy

This article explains the Java callback mechanism step by step using a kindergarten story, showing how simple addition can evolve into interface‑based callbacks with a SuperCalculator, and demonstrates the pattern with concrete Student, Calculator, Seller, and doJob implementations.

DesignPatternJavaOOP
0 likes · 13 min read
Understanding Java Callback Mechanism Through a Classroom Analogy