Tagged articles
121 articles
Page 2 of 2
FunTester
FunTester
Feb 15, 2020 · Backend Development

Understanding Double-Checked Locking Singleton Pattern in Java

This article explains the double‑checked locking design pattern for thread‑safe singletons in Java, demonstrates its performance drawbacks, and presents alternative implementations such as early initialization, init‑on‑demand holder, and enum‑based singletons, highlighting their advantages and limitations.

JavaSingletonconcurrency
0 likes · 6 min read
Understanding Double-Checked Locking Singleton Pattern in Java
Selected Java Interview Questions
Selected Java Interview Questions
Nov 24, 2019 · Fundamentals

Introduction to the Singleton Design Pattern

The Singleton pattern ensures a class has only one instance, providing a global point of access, and is explained with its definition, implementation steps, advantages, disadvantages, thread‑safety concerns, usage guidelines, and typical real‑world scenarios such as configuration management, logging, and resource pooling.

JavaObject-OrientedSingleton
0 likes · 9 min read
Introduction to the Singleton Design Pattern
Selected Java Interview Questions
Selected Java Interview Questions
Oct 20, 2019 · Fundamentals

Java Singleton Pattern Implementations and Variants

This article explains four main categories of Java singleton implementations—eager (hungry), lazy (lazy), holder, and enum—detailing their basic forms, variations, thread‑safety characteristics, performance trade‑offs, and code examples, while also discussing pitfalls such as reflection and serialization.

JavaSingletondesign pattern
0 likes · 10 min read
Java Singleton Pattern Implementations and Variants
Programmer DD
Programmer DD
Sep 3, 2019 · Backend Development

Mastering Java State Machines with Enums: A Practical Guide

This article explains how Java developers can replace cumbersome if‑else status handling with a finite state machine implemented via enums, illustrating concepts, design patterns, and a complete example of an order‑delivery workflow, complete with diagrams and sample code.

Backend DevelopmentJavadesign pattern
0 likes · 6 min read
Mastering Java State Machines with Enums: A Practical Guide
Java Captain
Java Captain
Oct 2, 2018 · Fundamentals

Understanding the Singleton Design Pattern in Java: Lazy, Eager, Double‑Check, Volatile, Static Inner Class and Enum Implementations

This article explains the Singleton design pattern in Java, covering its definition, the differences between lazy and eager implementations, thread‑safety issues, multiple code versions (simple, synchronized, double‑checked locking, volatile), and alternative approaches using static inner classes and enums, while discussing atomic operations and instruction reordering.

JavaSingletondesign pattern
0 likes · 14 min read
Understanding the Singleton Design Pattern in Java: Lazy, Eager, Double‑Check, Volatile, Static Inner Class and Enum Implementations
Java Backend Technology
Java Backend Technology
Apr 17, 2018 · Backend Development

Mastering the Singleton Pattern in Java: Eager, Lazy, and Thread‑Safe Implementations

This article explains the concept of design patterns and dives deep into the Singleton pattern in Java, covering its purpose, eager and lazy implementations, thread‑safety challenges, double‑checked locking, volatile usage, static inner class, and enum approaches, while illustrating each with clear code examples and diagrams.

Double-Check LockingJavaSingleton
0 likes · 11 min read
Mastering the Singleton Pattern in Java: Eager, Lazy, and Thread‑Safe Implementations
Java Captain
Java Captain
Feb 26, 2018 · Fundamentals

Java Dynamic Proxy Mechanism and Design Pattern Overview

This article explains the Proxy design pattern, details Java's dynamic proxy classes and interfaces from JDK 1.6 source, walks through the step‑by‑step creation process, presents a complete demo implementation, and analyzes the underlying Proxy class generation and InvocationHandler mechanisms.

Dynamic ProxyJDKJava
0 likes · 13 min read
Java Dynamic Proxy Mechanism and Design Pattern Overview
Programmer DD
Programmer DD
Dec 6, 2017 · Fundamentals

Mastering Java Singleton: From Lazy Initialization to Enum with Thread‑Safety

This article walks through multiple Java Singleton implementations—lazy initialization, double‑checked locking, volatile‑protected, static‑inner‑class, and enum—explaining their thread‑safety characteristics, the pitfalls of instruction reordering, and how reflection and serialization can break or preserve the pattern.

JavaSingletondesign pattern
0 likes · 10 min read
Mastering Java Singleton: From Lazy Initialization to Enum with Thread‑Safety
Senior Brother's Insights
Senior Brother's Insights
Dec 4, 2017 · Fundamentals

Mastering Thread‑Safe Singleton in Java: Double‑Check, Static Holder, Enum & Reflection Hacks

Explore multiple Java singleton implementations—including a thread‑safe double‑checked locking version, a static inner‑class approach, an enum‑based solution, and a reflection‑based attack—while learning their key technical details, advantages, pitfalls, and how to protect against serialization and reflection vulnerabilities.

JavaReflectionSingleton
0 likes · 6 min read
Mastering Thread‑Safe Singleton in Java: Double‑Check, Static Holder, Enum & Reflection Hacks
Java Captain
Java Captain
Nov 13, 2017 · Fundamentals

Understanding the Singleton Design Pattern in Java: Implementations, Thread Safety, and Best Practices

This article explains the Singleton design pattern in Java, covering its definition, lazy and eager implementations, thread‑safety issues such as double‑checked locking and volatile, and alternative approaches like static inner classes and enums, providing code examples and practical insights.

Singletondesign patterndouble-checked locking
0 likes · 14 min read
Understanding the Singleton Design Pattern in Java: Implementations, Thread Safety, and Best Practices
MaGe Linux Operations
MaGe Linux Operations
Oct 5, 2017 · Fundamentals

Master Python Decorators: Concepts, Usage, and Design Patterns

This article explains what Python decorators are, their key characteristics, how to pass arguments, stack multiple decorators, use built‑in decorators from the standard library such as @property and @wraps, and relates decorator functions to the classic decorator design pattern, all illustrated with clear code examples.

Code Exampledesign patternfunctools
0 likes · 7 min read
Master Python Decorators: Concepts, Usage, and Design Patterns
Java Captain
Java Captain
Aug 22, 2017 · Fundamentals

Understanding Java Static and Dynamic Proxy Patterns

This article explains the concept of the Proxy design pattern, demonstrates how to implement static and dynamic proxies in Java with complete source code, and analyzes the advantages, limitations, and internal workings of Java's runtime-generated proxy classes.

Dynamic ProxyProxyReflection
0 likes · 15 min read
Understanding Java Static and Dynamic Proxy Patterns
Tencent TDS Service
Tencent TDS Service
Mar 9, 2017 · Mobile Development

Mastering the Singleton Pattern in Android: Pitfalls, Best Practices, and Real‑World Implementations

This article explores the Singleton design pattern in depth, covering its definition, various Java implementations, thread‑safety concerns, serialization, reflection and cloning pitfalls, Android‑specific considerations, and practical recommendations for using singletons effectively in mobile projects.

JavaSingletondesign pattern
0 likes · 38 min read
Mastering the Singleton Pattern in Android: Pitfalls, Best Practices, and Real‑World Implementations

Why the Singleton Pattern Matters: Lazy Loading, Thread Safety, and Real‑World Java Examples

This article explains the Singleton design pattern in Java, illustrates why a single instance is essential for configuration classes, compares eager and lazy initialization, shows thread‑safe implementations, and demonstrates extensions that limit the number of instances with practical code samples.

JavaSingletondesign pattern
0 likes · 12 min read
Why the Singleton Pattern Matters: Lazy Loading, Thread Safety, and Real‑World Java Examples