Tagged articles
165 articles
Page 1 of 2
java1234
java1234
Mar 24, 2026 · Backend Development

Key Design Patterns Used in the Spring Framework

This article explains how Spring employs five core design patterns—Factory, Singleton, Proxy, Observer, and Template Method—detailing their roles, code examples, and how they contribute to Spring's modular, extensible architecture.

Design PatternsFactory PatternObserver
0 likes · 8 min read
Key Design Patterns Used in the Spring Framework
Data STUDIO
Data STUDIO
Jan 19, 2026 · Fundamentals

10 Advanced Python Decorators to Replace Repetitive if‑else Logic and Clean Up Your Code

This article introduces ten practical Python decorator patterns—covering caching, timing, retry, rate‑limiting, logging, dependency injection, class‑wide decoration, singleton, role‑based access control, and context management—each explained with concrete code examples, output snapshots, and guidance on when and how to apply them.

PythonRBACRetry
0 likes · 29 min read
10 Advanced Python Decorators to Replace Repetitive if‑else Logic and Clean Up Your Code
Tech Freedom Circle
Tech Freedom Circle
Jan 16, 2026 · Interview Experience

Crack JD Interview: Master Singleton, Factory, Strategy, Template & Observer Patterns in 20 Minutes

This article offers a systematic, high‑concurrency‑focused walkthrough of core Java design patterns—including Singleton, Factory, Strategy, Template Method, and Observer—complete with code examples, pros and cons, selection guidelines, and interview‑ready explanations to help candidates impress interviewers and secure offers.

Design PatternsFactoryJava
0 likes · 36 min read
Crack JD Interview: Master Singleton, Factory, Strategy, Template & Observer Patterns in 20 Minutes
Java One
Java One
Dec 12, 2025 · Backend Development

Understanding Spring Bean Scopes: When Singleton Becomes Prototype

This article explains how Spring manages bean instances, compares singleton and prototype scopes with concrete code examples, and shows why two injected beans may be equal or different depending on the @Scope annotation applied to the component class.

Bean ScopeJavaSingleton
0 likes · 3 min read
Understanding Spring Bean Scopes: When Singleton Becomes Prototype
macrozheng
macrozheng
Nov 21, 2025 · Backend Development

Master Java Concurrency: Locks, Singleton Patterns, ThreadLocal, Reflection and More

This article provides a comprehensive guide to Java concurrency and related concepts, covering synchronized lock upgrades, object vs class locks, lazy and double‑checked singleton implementations, ThreadLocal mechanics, reflection usage, annotation scopes, JVM class loading, and Redis cluster threading behavior.

JVMJavaReflection
0 likes · 22 min read
Master Java Concurrency: Locks, Singleton Patterns, ThreadLocal, Reflection and More
Code Wrench
Code Wrench
Nov 11, 2025 · Backend Development

Unlock High‑Maintainability Go Projects with 20+ Creational & Structural Design Patterns

This guide walks Go developers through essential creational and structural design patterns—Singleton, Simple Factory, Factory Method, Abstract Factory, Builder, and Facade—explaining their principles, Go implementations, pros and cons, and real‑world use cases to build scalable, loosely‑coupled systems.

Backend DevelopmentBuilderDesign Patterns
0 likes · 11 min read
Unlock High‑Maintainability Go Projects with 20+ Creational & Structural Design Patterns
IT Services Circle
IT Services Circle
Oct 31, 2025 · Backend Development

Master Java Concurrency, Singleton, ThreadLocal, and Reflection for Interviews

This guide covers essential Java interview topics—including synchronized lock upgrades, object vs class locking, lazy and double‑checked singleton patterns, ThreadLocal mechanics, reflection usage, annotation scopes, Redis cluster behavior, and a linear‑time algorithm challenge—providing clear explanations, code examples, and practical insights for developers preparing for technical interviews.

JavaReflectionSingleton
0 likes · 20 min read
Master Java Concurrency, Singleton, ThreadLocal, and Reflection for Interviews
Liangxu Linux
Liangxu Linux
Aug 31, 2025 · Fundamentals

Mastering C++ static: 6 Powerful Uses You Must Know

This article explains the versatile static keyword in C++ by covering six practical patterns—including local static variables, file‑scope static globals, static class members, static member functions, lazy‑initialized singletons, and compile‑time constants—complete with clear code examples and usage tips.

C++ConstantsSingleton
0 likes · 9 min read
Mastering C++ static: 6 Powerful Uses You Must Know
php Courses
php Courses
Jun 26, 2025 · Fundamentals

Master Go Design Patterns: Practical Implementations & Best Practices

This article explores common design patterns in Go, explaining how the language’s emphasis on simplicity, composition, and interfaces influences implementations of Singleton, Factory, Strategy, Observer, and more, while providing idiomatic code examples and best‑practice recommendations such as using sync.Once, dependency injection, and context for robust, maintainable Go applications.

Design PatternsFactoryObserver
0 likes · 8 min read
Master Go Design Patterns: Practical Implementations & Best Practices
php Courses
php Courses
Jun 20, 2025 · Backend Development

Master PHP Design Patterns: Singleton, Factory, Observer, and Adapter

This article explains four essential PHP design patterns—Singleton, Factory, Observer, and Adapter—detailing their purpose, implementation with code examples, and how they help developers write more maintainable, extensible, and flexible backend applications.

AdapterDesign PatternsFactory
0 likes · 7 min read
Master PHP Design Patterns: Singleton, Factory, Observer, and Adapter
php Courses
php Courses
Apr 10, 2025 · Backend Development

Common Design Patterns in PHP Web Service Development

This article introduces essential design patterns for PHP web service development, such as Factory, Singleton, Observer, Strategy, and Dependency Injection, explains their implementation with code examples, discusses their benefits for code reuse, maintainability, and scalability, and offers guidance on selecting appropriate patterns in modern PHP frameworks.

Design PatternsFactory PatternObserver
0 likes · 8 min read
Common Design Patterns in PHP Web Service Development
Code Mala Tang
Code Mala Tang
Apr 3, 2025 · Fundamentals

Unlock Python’s Ellipsis (…) – Powerful Uses Beyond Slicing

Discover how Python’s three-dot ellipsis (…) isn’t just a placeholder but a versatile singleton object used for slicing multidimensional arrays, marking unfinished code, enhancing type hints, and even evaluating to True, with practical examples and insights into its unique behavior.

NumPyPythonSingleton
0 likes · 6 min read
Unlock Python’s Ellipsis (…) – Powerful Uses Beyond Slicing
Test Development Learning Exchange
Test Development Learning Exchange
Mar 6, 2025 · Fundamentals

Understanding Class Attributes in Object‑Oriented Programming with Examples

This article explains the concept of class attributes in object‑oriented programming, contrasts them with instance attributes, and demonstrates ten practical scenarios—including shared data, default values, instance counting, singleton and factory patterns—through clear Python code examples and usage guidelines.

Class AttributesFactoryPython
0 likes · 10 min read
Understanding Class Attributes in Object‑Oriented Programming with Examples
Python Programming Learning Circle
Python Programming Learning Circle
Mar 5, 2025 · Fundamentals

Implementing a Python Singleton with Decorators

This article explains the singleton design pattern in Python, demonstrates how to implement it using a decorator with a wrapper class, provides step‑by‑step code examples, discusses its advantages, appropriate use cases, and cautions against overuse.

DecoratorPythonSingleton
0 likes · 7 min read
Implementing a Python Singleton with Decorators
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 27, 2025 · Fundamentals

Master 7 Essential Java Design Patterns with Real-World Spring Boot Examples

This article introduces seven core design patterns—Singleton, Factory, Builder, Strategy, Observer, Proxy, and Template—explaining their purpose, typical use cases, and providing complete Java code examples that integrate with Spring Boot 3 and Java 21, helping developers write cleaner, more maintainable software.

BuilderDesign PatternsFactory
0 likes · 20 min read
Master 7 Essential Java Design Patterns with Real-World Spring Boot Examples
Top Architect
Top Architect
Jan 4, 2025 · Backend Development

A Comprehensive Guide to Java Enums: Basics, Advanced Techniques, and Design Patterns

This article explains what Java enums are, why they are preferable to constants, demonstrates basic and custom enum definitions, shows how to compare, switch, and extend enums with properties, methods and constructors, and explores advanced uses such as EnumSet, EnumMap, Singleton and Strategy patterns, including Java 8 stream examples and JSON serialization.

Design PatternsEnumMapEnumSet
0 likes · 16 min read
A Comprehensive Guide to Java Enums: Basics, Advanced Techniques, and Design Patterns
Open Source Tech Hub
Open Source Tech Hub
Dec 15, 2024 · Backend Development

Mastering PHP IoC: Build a Singleton Container from Scratch

This tutorial explains how to create a lightweight Inversion of Control (IoC) container in PHP, covering the singleton pattern, binding services, PSR‑11 compliance, retrieving and injecting dependencies, and implementing class and method resolvers with practical code examples.

ContainerIoCPHP
0 likes · 16 min read
Mastering PHP IoC: Build a Singleton Container from Scratch
Su San Talks Tech
Su San Talks Tech
Dec 11, 2024 · Fundamentals

8 Essential Design Patterns Every Java Developer Should Master

This article introduces eight core design patterns—Singleton, Factory, Strategy, Proxy, Observer, Decorator, Template Method, and Builder—explaining their concepts, providing Java code examples, and showing typical JDK and Spring framework usages to help developers write cleaner, more maintainable code.

BuilderDecoratorDesign Patterns
0 likes · 12 min read
8 Essential Design Patterns Every Java Developer Should Master
Python Programming Learning Circle
Python Programming Learning Circle
Nov 5, 2024 · Fundamentals

Implementing the Singleton Pattern in Python: Multiple Approaches and Thread Safety

This article explains the Singleton design pattern in Python, covering various implementation methods—including modules, decorators, classic classes, __new__ method, and metaclasses—while demonstrating thread‑safety concerns and solutions with locking, and provides complete code examples for each approach.

DecoratorMetaclassSingleton
0 likes · 10 min read
Implementing the Singleton Pattern in Python: Multiple Approaches and Thread Safety
Test Development Learning Exchange
Test Development Learning Exchange
Sep 5, 2024 · Backend Development

Build a Clean, Efficient MySQL Utility Class in Python

This article walks you through designing a lightweight, high‑performance MySQL helper class in Python, covering singleton connection management, robust exception handling, logging, context‑managed connections, and practical query/execute methods with example code and usage scenarios.

Error HandlingPythonSingleton
0 likes · 7 min read
Build a Clean, Efficient MySQL Utility Class in Python
Tencent Cloud Developer
Tencent Cloud Developer
Aug 30, 2024 · Fundamentals

Overview of 10 Classic Software Design Patterns with Go Examples

The article presents ten classic software design patterns—Singleton, Factory, Observer, Decorator, Strategy, Adapter, Proxy, Command, Composite, and Iterator—explaining each pattern’s features, advantages, disadvantages, typical applications, and providing concrete Go code examples to illustrate their implementation.

DecoratorFactoryGo
0 likes · 36 min read
Overview of 10 Classic Software Design Patterns with Go Examples
IT Architects Alliance
IT Architects Alliance
Aug 2, 2024 · Fundamentals

Mastering Design Patterns: Strategy, Factory, Singleton, Proxy, Observer, Template & Adapter in Java

This article provides a comprehensive, code‑first guide to the most common design patterns—including Strategy, Simple Factory, Singleton, Proxy, Factory Method, Observer, Template Method and Adapter—explaining their concepts, real‑world use cases, and complete Java implementations with Spring Boot integration.

AdapterDesign PatternsFactory
0 likes · 21 min read
Mastering Design Patterns: Strategy, Factory, Singleton, Proxy, Observer, Template & Adapter in Java
Architect
Architect
Jul 24, 2024 · Fundamentals

Master Design Patterns: Real‑World Examples and Complete Java Implementations

This article introduces design patterns, lists the most common patterns such as Strategy, Factory, Singleton, Proxy, Factory Method, Observer, Template Method, and Adapter, and walks through concrete Java code examples, step‑by‑step explanations, and practical scenarios that demonstrate how each pattern solves specific design problems.

AdapterDesign PatternsFactory Pattern
0 likes · 23 min read
Master Design Patterns: Real‑World Examples and Complete Java Implementations
Architect's Guide
Architect's Guide
Jul 20, 2024 · Backend Development

Spring Controller Scope: Singleton vs Prototype and Concurrency Safety

The article explains that Spring MVC controllers are singleton by default, which makes mutable instance fields unsafe for concurrent requests, demonstrates the issue with sample code, and shows how applying @Scope("prototype") or using ThreadLocal resolves the thread‑safety problem.

JavaSingletonconcurrency
0 likes · 4 min read
Spring Controller Scope: Singleton vs Prototype and Concurrency Safety
macrozheng
macrozheng
May 24, 2024 · Backend Development

Master Java Design Patterns: Strategy, Chain, Template, Observer, Factory & Singleton

This article explains the core concepts, typical business scenarios, definitions, and concrete Java implementations of six fundamental design patterns—Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton—showing how they improve code maintainability, extensibility, and adherence to SOLID principles.

SingletonSoftware ArchitectureStrategy Pattern
0 likes · 24 min read
Master Java Design Patterns: Strategy, Chain, Template, Observer, Factory & Singleton
Architect
Architect
May 20, 2024 · Backend Development

Unlocking MyBatis: 10+ Design Patterns Powering Its Architecture

This article dissects MyBatis's source code, revealing how more than ten classic design patterns—such as Factory, Singleton, Builder, Adapter, Proxy, Composite, Decorator, Template, Strategy, and Iterator—are applied to decouple complex scenarios, improve extensibility, and streamline ORM operations.

AdapterBackend DevelopmentBuilder
0 likes · 11 min read
Unlocking MyBatis: 10+ Design Patterns Powering Its Architecture
Liangxu Linux
Liangxu Linux
May 8, 2024 · Fundamentals

Bypassing WeChat’s Singleton Check: Run Multiple Instances on Windows

This guide explains how a simple batch file can launch two or more WeChat instances on Windows by analyzing the app’s global mutex mechanism, reverse‑engineering the related DLL functions, and showing why the rapid start‑up bypasses the built‑in single‑instance guard.

BatchSingletonWeChat
0 likes · 6 min read
Bypassing WeChat’s Singleton Check: Run Multiple Instances on Windows
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 29, 2024 · Frontend Development

Practical Frontend Techniques: Vite Auto Routing, await-to-js Source Walkthrough, URL Parameter Handling, Controlling forEach Loops, and Singleton Request Management

This article presents practical frontend solutions, including automatic route generation in Vite projects using unplugin-vue-router, a detailed source analysis of the await‑to‑js error‑handling wrapper, methods for extracting URL parameters, techniques to terminate or replace forEach loops, and patterns for avoiding duplicate component requests.

JavaScriptSingletonforeach
0 likes · 17 min read
Practical Frontend Techniques: Vite Auto Routing, await-to-js Source Walkthrough, URL Parameter Handling, Controlling forEach Loops, and Singleton Request Management
Sohu Tech Products
Sohu Tech Products
Mar 6, 2024 · Fundamentals

JavaScript Design Patterns: A Comprehensive Guide

This guide explains JavaScript design patterns—creational, structural, and behavioral—detailing common examples such as Singleton, Factory, Module, Decorator, Observer, Strategy, and more, and shows how applying these proven solutions can make code clearer, more flexible, maintainable, and scalable.

Behavioral PatternsCreational PatternsDesign Patterns
0 likes · 28 min read
JavaScript Design Patterns: A Comprehensive Guide
php Courses
php Courses
Jan 22, 2024 · Backend Development

Common Design Patterns in PHP: Singleton, Factory, Observer, and Adapter

This article introduces four essential design patterns—Singleton, Factory, Observer, and Adapter—explaining their concepts and providing complete PHP code examples to demonstrate how each pattern can be implemented to create maintainable, extensible, and flexible applications.

AdapterDesign PatternsFactory
0 likes · 7 min read
Common Design Patterns in PHP: Singleton, Factory, Observer, and Adapter
php Courses
php Courses
Nov 30, 2023 · Backend Development

Best Practices and Performance Optimization for the Singleton Pattern in PHP

This article explains the Singleton design pattern in PHP, covering best‑practice guidelines such as a private constructor, static accessor methods, and static instance storage, and presents performance‑enhancing techniques like lazy instantiation and safe serialization/deserialization with illustrative code examples.

PHPSingletonbest practices
0 likes · 5 min read
Best Practices and Performance Optimization for the Singleton Pattern in PHP
Liangxu Linux
Liangxu Linux
Nov 13, 2023 · Fundamentals

Mastering C++ Class Design: Best Practices and Common Pitfalls

This guide walks through essential C++ class design techniques—including header guards, private data encapsulation, const-correctness, initializer lists, reference parameters, operator overloading, static members, the Big Three, deep vs shallow copying, and singleton patterns—to help you write robust, maintainable code.

C++Singletonclass design
0 likes · 13 min read
Mastering C++ Class Design: Best Practices and Common Pitfalls
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 6, 2023 · Fundamentals

Fundamental OOP Concepts and Design Patterns in Java

This article explains core object‑oriented concepts such as encapsulation, abstraction, inheritance and polymorphism, then details common design principles and a wide range of design patterns—including factory, builder, bridge, singleton, strategy, adapter, and proxy—illustrated with complete Java code examples and usage guidelines.

AdapterDesign PatternsFactory
0 likes · 23 min read
Fundamental OOP Concepts and Design Patterns in Java
Test Development Learning Exchange
Test Development Learning Exchange
Oct 29, 2023 · Fundamentals

Common Design Patterns in Python

This article lists and briefly explains fifteen common Python design patterns, including Singleton, Factory, Abstract Factory, Builder, Prototype, Adapter, Decorator, Proxy, Observer, Strategy, Template Method, Iterator, Chain of Responsibility, Command, and State, helping developers understand their purposes and usage.

Design PatternsFactoryPython
0 likes · 4 min read
Common Design Patterns in Python
Test Development Learning Exchange
Test Development Learning Exchange
Oct 28, 2023 · Fundamentals

Understanding the Object Factory Design Pattern with Python Examples

Object Factory is a design pattern that centralizes object creation, enhancing decoupling, extensibility, and management of instances, and this article explains its principles, benefits, and provides five Python code examples illustrating various scenarios such as type-based creation, configuration-driven instantiation, logging factories, singleton factories, and object caching.

Factory MethodObject FactoryPython
0 likes · 7 min read
Understanding the Object Factory Design Pattern with Python Examples
php Courses
php Courses
Oct 16, 2023 · Backend Development

Best Practices and Performance Optimization of the Singleton Pattern in PHP

This article explains the Singleton pattern in PHP, detailing best practices such as private constructors and static access methods, and presents performance optimizations including lazy instantiation and proper serialization handling, accompanied by concrete code examples.

Backend DevelopmentPHPPerformance Optimization
0 likes · 6 min read
Best Practices and Performance Optimization of the Singleton Pattern in PHP
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
Code Ape Tech Column
Code Ape Tech Column
Oct 2, 2023 · Backend Development

Design Patterns Used in the MyBatis Framework

This article reviews the various design patterns—creational, structural, and behavioral—employed within MyBatis's source code, illustrating each pattern with diagrams and explaining their roles in simplifying factory creation, singleton configuration, builders, adapters, proxies, decorators, templates, strategies, and iterators.

Backend DevelopmentDesign PatternsFactory Pattern
0 likes · 12 min read
Design Patterns Used in the MyBatis Framework
Java Interview Crash Guide
Java Interview Crash Guide
Sep 19, 2023 · Backend Development

How MyBatis Leverages 10+ Design Patterns to Simplify Complex Scenarios

The article examines how MyBatis applies a variety of creational, structural, and behavioral design patterns—such as Factory, Singleton, Builder, Adapter, Proxy, Composite, Decorator, Template, Strategy, and Iterator—to decouple its over‑twenty‑thousand‑line codebase, improve modularity, and handle complex ORM tasks efficiently.

AdapterBackend DevelopmentBuilder
0 likes · 8 min read
How MyBatis Leverages 10+ Design Patterns to Simplify Complex Scenarios
Java Architect Essentials
Java Architect Essentials
Sep 12, 2023 · Fundamentals

Why volatile and synchronized Can't Prevent Instruction Reordering in Java

An in‑depth analysis of Java’s instruction reordering versus ordered execution, illustrating how volatile ensures visibility but not atomicity, how synchronized guarantees atomicity and ordering yet cannot stop bytecode‑level reordering, with detailed DCL singleton bytecode walkthrough and multithreaded examples.

Instruction ReorderingJavaSingleton
0 likes · 7 min read
Why volatile and synchronized Can't Prevent Instruction Reordering in Java
Ant R&D Efficiency
Ant R&D Efficiency
Sep 5, 2023 · R&D Management

Singleton Modification Leads to Code Quality Issues: Analysis and Improvement Suggestions

A recent change that turned a factory method into a hidden singleton caused callers to unintentionally share mutable state, exposing three core problems—unprotected singleton semantics, unchanged interfaces, and patch‑style fixes—and the author recommends better encapsulation, continuous design improvement, regular code reviews, pair programming, and incentive structures that reward genuine code quality.

ManagementSingletonTeam Practices
0 likes · 6 min read
Singleton Modification Leads to Code Quality Issues: Analysis and Improvement Suggestions
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 31, 2023 · Fundamentals

JavaScript Design Patterns: Factory Method, Abstract Factory, Singleton, Builder, Prototype and More

This article introduces JavaScript design patterns—covering creational, structural, and behavioral categories—and provides clear explanations and complete code examples for patterns such as Factory Method, Abstract Factory, Singleton, Builder, Prototype, Adapter, Decorator, Proxy, Facade, Bridge, Composite, Flyweight, Strategy, Template Method, Observer, Iterator, Chain of Responsibility, Command, Memento, State, Visitor, Mediator and Interpreter, helping developers write cleaner, more maintainable code.

AdapterBuilderDecorator
0 likes · 35 min read
JavaScript Design Patterns: Factory Method, Abstract Factory, Singleton, Builder, Prototype and More
Java Interview Crash Guide
Java Interview Crash Guide
Aug 30, 2023 · Backend Development

How Spring Implements Classic Design Patterns: Factory, Singleton, and More

This article explains how Spring applies classic design patterns such as Simple Factory, Factory Method, Singleton, Adapter, Decorator, Proxy, Observer, Strategy, and Template Method, illustrating each pattern with implementation details, core code snippets, and their significance for loose coupling and extensibility in backend development.

AdapterBackendFactory
0 likes · 15 min read
How Spring Implements Classic Design Patterns: Factory, Singleton, and More
Test Development Learning Exchange
Test Development Learning Exchange
Jul 7, 2023 · Fundamentals

Common Design Patterns in Python

This article lists and briefly describes fifteen widely used design patterns in Python, including Singleton, Factory, Abstract Factory, Builder, Prototype, Adapter, Decorator, Proxy, Observer, Strategy, Template Method, Iterator, Chain of Responsibility, Command, and State patterns.

BuilderDesign PatternsFactory
0 likes · 4 min read
Common Design Patterns in Python
php Courses
php Courses
Jun 29, 2023 · Backend Development

Understanding the static Keyword in PHP: Properties, Methods, and Use Cases

This article explains PHP's static keyword, covering static properties and methods, memory management, common use cases such as utility functions and the singleton pattern, and important considerations for visibility and inheritance, accompanied by clear code examples.

BackendDesign PatternsSingleton
0 likes · 8 min read
Understanding the static Keyword in PHP: Properties, Methods, and Use Cases
macrozheng
macrozheng
Jun 19, 2023 · Backend Development

Unlocking Java Enums: Deep Dive into Their Essence and Powerful Uses

This article explains what Java enums are, how they compile into classes that extend java.lang.Enum, demonstrates core methods and practical patterns such as singleton implementation and abstract‑method strategies, and provides clear code examples to help developers master enum usage.

Design PatternsJavaSingleton
0 likes · 7 min read
Unlocking Java Enums: Deep Dive into Their Essence and Powerful Uses
MaGe Linux Operations
MaGe Linux Operations
May 23, 2023 · Fundamentals

Mastering the Singleton Pattern in Python: Thread‑Safe Implementations

This article explains the purpose of the Singleton pattern, demonstrates multiple Python implementations—including module‑based, decorator, class‑based, __new__ method, and metaclass approaches—covers thread‑safety with locking, and provides complete code examples for each technique.

MetaclassSingletondesign pattern
0 likes · 10 min read
Mastering the Singleton Pattern in Python: Thread‑Safe Implementations
Python Programming Learning Circle
Python Programming Learning Circle
May 13, 2023 · Fundamentals

Implementing the Singleton Pattern in Python: Modules, Decorators, Classes, __new__ Method, and Metaclasses

This article explains the Singleton design pattern in Python, describing why a single instance may be needed, and demonstrates five implementation techniques—including module-level singletons, decorators, class methods, the __new__ method, and metaclasses—while addressing thread‑safety concerns with locking mechanisms.

MetaclassSingletondesign pattern
0 likes · 10 min read
Implementing the Singleton Pattern in Python: Modules, Decorators, Classes, __new__ Method, and Metaclasses
Python Programming Learning Circle
Python Programming Learning Circle
Mar 6, 2023 · Fundamentals

A Guide to Useful Python Decorators

This article introduces several practical Python decorators—including @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, and @singledispatch—explaining their purposes, benefits, and providing code examples to demonstrate how they can improve performance, readability, and functionality in Python programs.

Singletondataclasslru_cache
0 likes · 9 min read
A Guide to Useful Python Decorators
The Dominant Programmer
The Dominant Programmer
Feb 9, 2023 · Fundamentals

Java Design Pattern Examples: A Comprehensive Collection

This article compiles practical Java code examples for common design patterns—including Simple Factory, Factory Method, Abstract Factory, Singleton (eager, lazy, static inner class, enum, container), Proxy, Decorator, Prototype, Strategy, Observer, and Adapter—each linked to detailed tutorials.

Design PatternsFactoryJava
0 likes · 3 min read
Java Design Pattern Examples: A Comprehensive Collection
macrozheng
macrozheng
Dec 17, 2022 · Fundamentals

Master 9 Essential Design Patterns for Cleaner Java Code

This article explains nine widely used design patterns—Singleton, Builder, Factory, Strategy, Template Method, Chain of Responsibility, Proxy, Adapter, and Observer—detailing their concepts, typical use‑cases, and concrete Java code examples drawn from popular open‑source projects such as Spring, Dubbo, MyBatis and Guava.

BuilderFactoryJava
0 likes · 27 min read
Master 9 Essential Design Patterns for Cleaner Java Code
macrozheng
macrozheng
Oct 27, 2022 · Fundamentals

Unlock Cleaner Code: Master 6 Essential Design Patterns with Real Java Examples

This article explores six core design patterns—Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton—explaining their real‑world business scenarios, underlying principles, and providing complete Java implementations to help developers write more maintainable, extensible, and principle‑compliant code.

Design PatternsJavaObserver
0 likes · 27 min read
Unlock Cleaner Code: Master 6 Essential Design Patterns with Real Java Examples
Su San Talks Tech
Su San Talks Tech
Oct 15, 2022 · Fundamentals

Unlock Cleaner Code: How Design Patterns Transform Everyday Java Development

This article explores common design patterns—including Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton—explaining their real‑world business scenarios, core principles, and providing concrete Java code examples to help developers write more maintainable and extensible software.

Chain of ResponsibilityFactoryObserver
0 likes · 23 min read
Unlock Cleaner Code: How Design Patterns Transform Everyday Java Development
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 8, 2022 · Frontend Development

Understanding the Singleton Pattern in JavaScript: Concepts, Implementations, and Real‑World Applications

This article explains the singleton design pattern, shows standard and lazy implementations in JavaScript with code examples, discusses reducing global variable pollution, and demonstrates practical usage in popular front‑end libraries such as Vuex, Ant Design message, and Axios request cancellation.

JavaScriptSingletonVuex
0 likes · 11 min read
Understanding the Singleton Pattern in JavaScript: Concepts, Implementations, and Real‑World Applications
Cognitive Technology Team
Cognitive Technology Team
Oct 5, 2022 · Fundamentals

Various Singleton Pattern Implementations in Java

This article explains multiple Java singleton implementations—including eager initialization, static block, lazy initialization, double‑checked locking, static inner‑class holder, and enum—detailing their code, thread‑safety characteristics, advantages, and limitations such as reflection and serialization issues.

JavaSingletondesign pattern
0 likes · 7 min read
Various Singleton Pattern Implementations in Java
Code Ape Tech Column
Code Ape Tech Column
Sep 16, 2022 · Backend Development

Ensuring Thread Safety for Spring Singleton Beans: Problems and Solutions

This article explains why Spring singleton beans can be unsafe in concurrent scenarios, demonstrates the issue with a controller example, and presents multiple solutions including changing bean scope, using ThreadLocal, avoiding member variables, employing concurrent collections, and leveraging distributed caches.

BackendBean ScopeSingleton
0 likes · 8 min read
Ensuring Thread Safety for Spring Singleton Beans: Problems and Solutions
Python Programming Learning Circle
Python Programming Learning Circle
Aug 16, 2022 · Fundamentals

Exploring Useful Python Decorators: @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, @singledispatch

This article introduces Python decorators, explains how they can modify function behavior, and provides practical examples of eight useful decorators—including @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, and @singledispatch—along with code snippets that demonstrate their implementation and benefits.

Code ExamplesJITSingleton
0 likes · 10 min read
Exploring Useful Python Decorators: @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, @singledispatch
NetEase LeiHuo UX Big Data Technology
NetEase LeiHuo UX Big Data Technology
Jul 3, 2022 · Fundamentals

Why Some Design Patterns Should Be Forgotten When Using Python

This article explains why traditional object‑oriented design patterns such as Strategy, Factory Method, Singleton, and Iterator often become unnecessary or overly complex in Python, illustrating with concise code examples how Python’s first‑class functions, dynamic typing, and built‑in constructs can replace them for clearer, more maintainable solutions.

Design PatternsFactory MethodIterator
0 likes · 12 min read
Why Some Design Patterns Should Be Forgotten When Using Python
FunTester
FunTester
Jun 22, 2022 · Backend Development

Implementing Go's sync.Once Behavior in Java Using ReentrantLock

This article explains the Go sync.Once primitive, demonstrates its one‑time execution with concurrent goroutines, and shows how to recreate the same functionality in Java by using a static collection and ReentrantLock to ensure a block of code runs only once across multiple threads.

JavaReentrantLockSingleton
0 likes · 5 min read
Implementing Go's sync.Once Behavior in Java Using ReentrantLock
Selected Java Interview Questions
Selected Java Interview Questions
Jun 8, 2022 · Backend Development

Elegant and Efficient Singleton Implementations in Java

This article explores various Java singleton patterns—including eager initialization, static blocks, lazy initialization, double‑checked locking, volatile variables, static inner‑class holder, and serialization handling—explaining their mechanisms, thread‑safety concerns, and how to choose the most appropriate implementation for robust, high‑performance backend systems.

Singletondesign patternthread safety
0 likes · 10 min read
Elegant and Efficient Singleton Implementations in Java
Top Architect
Top Architect
Apr 29, 2022 · Backend Development

Understanding Spring MVC Controller Singleton Scope and Thread Safety

The article explains that Spring MVC Controllers are singleton beans by default, discusses the thread‑safety risks of using instance variables in such Controllers, and presents several solutions—including prototype scope, ThreadLocal, and AtomicInteger—to ensure safe concurrent handling of requests.

Backend DevelopmentControllerJava
0 likes · 7 min read
Understanding Spring MVC Controller Singleton Scope and Thread Safety
Sohu Tech Products
Sohu Tech Products
Apr 27, 2022 · Backend Development

Design Patterns Used in the Austin Project: Chain of Responsibility, Template Method, Builder, Strategy, Producer‑Consumer, Singleton, and Proxy

This article explains how the Austin Java backend project applies several classic design patterns—including Chain of Responsibility, Template Method, Builder, Strategy, Producer‑Consumer, Singleton, and Proxy—detailing their benefits, drawbacks, and specific code locations for each pattern.

BuilderChain of ResponsibilityDesign Patterns
0 likes · 6 min read
Design Patterns Used in the Austin Project: Chain of Responsibility, Template Method, Builder, Strategy, Producer‑Consumer, Singleton, and Proxy
IT Architects Alliance
IT Architects Alliance
Mar 28, 2022 · Fundamentals

A Humorous Introduction to 23 Classic Design Patterns

This article humorously explains 23 classic software design patterns—such as Factory Method, Builder, Abstract Factory, Prototype, Singleton, Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy, Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor—using everyday dating analogies to illustrate their intent and structure.

AdapterBuilderFactory Method
0 likes · 19 min read
A Humorous Introduction to 23 Classic Design Patterns
macrozheng
macrozheng
Mar 18, 2022 · Backend Development

How Spring Solves Circular Dependencies: Deep Dive into Three-Level Caches

This article explains why Spring’s circular dependency problem only occurs with singleton beans, how constructor versus setter injection affects resolution, and why Spring uses a three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories) to expose incomplete beans and support proxy creation without breaking the bean lifecycle.

SingletonThree-level Cachespring
0 likes · 12 min read
How Spring Solves Circular Dependencies: Deep Dive into Three-Level Caches
Top Architect
Top Architect
Mar 14, 2022 · Backend Development

Understanding Spring Controller Scope: Singleton vs Prototype and Best Practices

This article explains why Spring MVC controllers are singleton by default, demonstrates the thread‑unsafe behavior of using instance fields, shows how applying @Scope("prototype") changes the behavior, and provides practical recommendations such as avoiding mutable fields, using prototype scope or ThreadLocal for safe controller design.

ControllerJavaSingleton
0 likes · 6 min read
Understanding Spring Controller Scope: Singleton vs Prototype and Best Practices
php Courses
php Courses
Jan 6, 2022 · Backend Development

Implementing Redis Cache in PHP Using the __call Magic Method

This article explains how to integrate Redis caching into PHP applications by leveraging the __call magic method to create cache, clear, and flush operations for model methods, enabling shared model layers, resource‑efficient caching, flexible data source selection, and clean, reusable code.

BackendModelPHP
0 likes · 7 min read
Implementing Redis Cache in PHP Using the __call Magic Method
Java Architect Essentials
Java Architect Essentials
Nov 24, 2021 · Backend Development

Understanding Spring Bean Scopes: Singleton vs Prototype

This article explains the differences between Spring's singleton and prototype bean scopes, describing how singleton beans are cached and shared across requests while prototype beans are created anew each time, and discusses their performance advantages, thread‑safety drawbacks, and practical implications for developers.

BackendBean ScopeJava
0 likes · 5 min read
Understanding Spring Bean Scopes: Singleton vs Prototype
Selected Java Interview Questions
Selected Java Interview Questions
Nov 20, 2021 · Backend Development

Design Pattern Summary in the Spring Framework

This article provides a comprehensive overview of the design patterns used in Spring, including Simple Factory, Factory Method, Singleton, Adapter, Decorator, Proxy, Observer, Strategy, and Template Method, with explanations of their implementation, principles, and practical code examples.

BeanFactoryDesign PatternsFactory Method
0 likes · 13 min read
Design Pattern Summary in the Spring Framework
Code Ape Tech Column
Code Ape Tech Column
Nov 12, 2021 · Fundamentals

Common Design Patterns in Java: Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton

This article introduces several classic Java design patterns—including Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton—explaining their business scenarios, core definitions, and providing complete code examples to demonstrate how each pattern improves code maintainability, extensibility, and adherence to SOLID principles.

Design PatternsFactoryJava
0 likes · 22 min read
Common Design Patterns in Java: Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 27, 2021 · Fundamentals

Common Design Patterns in Daily Development: Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton

This article introduces several classic design patterns—Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton—explaining their business scenarios, core definitions, Java implementations, and how to apply them in real-world projects to improve code maintainability and extensibility.

Chain of ResponsibilityDesign PatternsFactory
0 likes · 27 min read
Common Design Patterns in Daily Development: Strategy, Chain of Responsibility, Template Method, Observer, Factory, and Singleton
Java Interview Crash Guide
Java Interview Crash Guide
Oct 20, 2021 · Backend Development

How Spring Implements Classic Design Patterns: From Simple Factory to Template Method

This article explains how Spring’s core container uses classic design patterns—Simple Factory via BeanFactory, Factory Method with FactoryBean, Singleton, Adapter, Decorator, Proxy, Observer, Strategy, and Template Method—illustrated with code snippets and diagrams to show their implementation and purpose within the framework.

BeanFactoryFactory MethodSingleton
0 likes · 15 min read
How Spring Implements Classic Design Patterns: From Simple Factory to Template Method
Architecture Digest
Architecture Digest
Oct 5, 2021 · Backend Development

Understanding Simple Factory, Factory Method, Singleton, Adapter, Decorator, Observer, Strategy, and Template Method Patterns in Spring

This article explains how Spring implements classic design patterns—including Simple Factory via BeanFactory, Factory Method with FactoryBean, Singleton with double‑checked locking, Adapter through HandlerAdapter, Decorator via Wrapper classes, Observer in its event model, Strategy via the Resource interface, and Template Method in JdbcTemplate—providing clear examples and code snippets for each.

Backend DevelopmentFactory MethodJava
0 likes · 13 min read
Understanding Simple Factory, Factory Method, Singleton, Adapter, Decorator, Observer, Strategy, and Template Method Patterns in Spring
Programmer DD
Programmer DD
Sep 14, 2021 · Backend Development

Why Spring MVC Controllers Are Singleton and How to Ensure Thread Safety

This article explains that Spring MVC controllers are singleton by default, illustrates the thread‑safety problems caused by shared instance variables with concrete code examples, and provides practical solutions such as avoiding state, using prototype scope, ThreadLocal, or AtomicInteger to make controllers safe under high concurrency.

ControllerJavaSingleton
0 likes · 6 min read
Why Spring MVC Controllers Are Singleton and How to Ensure Thread Safety
Top Architect
Top Architect
Jul 23, 2021 · Backend Development

Design Patterns in the Spring Framework: A Comprehensive Overview

This article provides a detailed overview of how the Spring framework implements classic design patterns—including Simple Factory, Factory Method, Singleton, Adapter, Decorator, Proxy, Observer, Strategy, and Template Method—illustrated with code snippets and explanations of their roles in Spring's dependency injection and bean lifecycle management.

Design PatternsJavaSingleton
0 likes · 14 min read
Design Patterns in the Spring Framework: A Comprehensive Overview
Java Backend Technology
Java Backend Technology
Jul 22, 2021 · Fundamentals

Master Java Enums: From Basics to Advanced Design Patterns

This article explains Java enums, their advantages over constants, demonstrates custom methods, comparisons, switch usage, advanced features like EnumSet, EnumMap, JSON serialization, and shows how enums can implement design patterns such as Singleton and Strategy with complete code examples.

Design PatternsEnumMapEnumSet
0 likes · 14 min read
Master Java Enums: From Basics to Advanced Design Patterns
Java High-Performance Architecture
Java High-Performance Architecture
Jun 7, 2021 · Fundamentals

23 Essential Design Patterns Explained with Fun Real‑World Analogies

This article humorously illustrates 23 classic software design patterns—such as Factory Method, Builder, Abstract Factory, Prototype, Singleton, Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy, Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor—by mapping each to everyday relationship scenarios.

AdapterBuilderDesign Patterns
0 likes · 18 min read
23 Essential Design Patterns Explained with Fun Real‑World Analogies
Programmer DD
Programmer DD
May 11, 2021 · Fundamentals

Mastering Java Constructors and Design Patterns: From Implicit to Singleton

This article provides a comprehensive guide to Java object creation, covering implicit, no‑argument, and argument constructors, initialization blocks, static initialization, default value guarantees, visibility rules, garbage collection, finalizers, and common construction patterns such as singleton, helper, factory, and dependency injection.

ConstructorsInitializationSingleton
0 likes · 17 min read
Mastering Java Constructors and Design Patterns: From Implicit to Singleton
Sohu Tech Products
Sohu Tech Products
May 5, 2021 · Fundamentals

Common Design Patterns in Kotlin: Singleton, Factory, Builder, Prototype, Decorator, Strategy, Template Method, and Observer

This article introduces several classic design patterns—Singleton, Factory, Builder, Prototype, Decorator, Strategy, Template Method, and Observer—showing how they can be implemented concisely in Kotlin with code examples, while also explaining the underlying language features such as object declarations, companion objects, delegation, lazy initialization, and higher‑order functions.

BuilderDesign PatternsFactory
0 likes · 23 min read
Common Design Patterns in Kotlin: Singleton, Factory, Builder, Prototype, Decorator, Strategy, Template Method, and Observer
Intelligent Backend & Architecture
Intelligent Backend & Architecture
May 5, 2021 · Fundamentals

Master Creational Design Patterns: Singleton, Prototype, Factory, Abstract Factory & Builder Explained

This comprehensive guide explains creational design patterns—including Singleton, Prototype, Factory Method, Abstract Factory, and Builder—detailing their definitions, characteristics, structures, Java implementations, code examples, and typical application scenarios for reducing coupling and improving flexibility in software development.

Abstract FactoryBuilderFactory Method
0 likes · 32 min read
Master Creational Design Patterns: Singleton, Prototype, Factory, Abstract Factory & Builder Explained