Tagged articles
8 articles
Page 1 of 1
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.

AndroidDesignPatternHTTP
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
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
Qunar Tech Salon
Qunar Tech Salon
Dec 19, 2018 · Backend Development

Eliminating Redundant TypeReference: A Deep Dive into Java Generic Type Capture

This article explores the limitations of Java generics, demonstrates how to remove repetitive TypeReference declarations by capturing generic type information via reflection, adds runtime validation for illegal generic types, and presents a comprehensive solution that handles Class, ParameterizedType, GenericArrayType, TypeVariable, and WildcardType.

BackendDesignPatternGenerics
0 likes · 9 min read
Eliminating Redundant TypeReference: A Deep Dive into Java Generic Type Capture
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