Tag

singleton

1 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
May 4, 2025 · Fundamentals

Technical Interview Q&A: TCP, Redis, Kafka, CAP Theorem, Singleton, C++ STL, and Algorithms

This guide reviews common backend interview topics, explaining TCP TIME_WAIT behavior, multi‑port listening, full page load steps, Redis data types, Kafka consumer sizing and at‑most‑once semantics, the CAP theorem, Singleton usage, C++ std::map complexity, and an O(n) doubly‑linked list reversal algorithm.

AlgorithmsC++CAP theorem
0 likes · 12 min read
Technical Interview Q&A: TCP, Redis, Kafka, CAP Theorem, Singleton, C++ STL, and Algorithms
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.

Factory PatternObserverPHP
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.

EllipsisNumPyPlaceholder
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.

decoratordesign patternprogramming
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.

BuilderFactoryJava
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.

EnumMapEnumSetJava
0 likes · 16 min read
A Comprehensive Guide to Java Enums: Basics, Advanced Techniques, and Design Patterns
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.

ModulePythonThread Safety
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 24, 2024 · Fundamentals

Understanding Python super() and Method Resolution Order (MRO) with Advanced Examples

This article explains how Python's super() works by invoking the next class in the Method Resolution Order (MRO), demonstrates MRO behavior with multiple inheritance examples, and presents advanced techniques such as metaclasses, descriptors, class decorators, __slots__, and singleton patterns.

MROMultiple InheritancePython
0 likes · 8 min read
Understanding Python super() and Method Resolution Order (MRO) with Advanced Examples
Selected Java Interview Questions
Selected Java Interview Questions
Sep 24, 2024 · Fundamentals

Understanding the Singleton Pattern: Lazy and Eager Implementations in Java

This article explains the Singleton design pattern, compares lazy and eager implementations in Java, discusses thread‑safety issues with double‑checked locking, presents complete code examples, and outlines the advantages, disadvantages, and appropriate use‑cases for singletons.

Eager InitializationJavaLazy Initialization
0 likes · 11 min read
Understanding the Singleton Pattern: Lazy and Eager Implementations in Java
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.

FactoryObserverStrategy
0 likes · 36 min read
Overview of 10 Classic Software Design Patterns with Go Examples
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.

ControllerJavaPrototype
0 likes · 4 min read
Spring Controller Scope: Singleton vs Prototype and Concurrency Safety
Test Development Learning Exchange
Test Development Learning Exchange
May 27, 2024 · Fundamentals

Implementing the Singleton Pattern in Python: Multiple Approaches

This article explains the Singleton design pattern in Python and presents seven implementation techniques—including module‑level variables, module instances, decorators, metaclasses, class methods, and thread‑safe approaches—complete with code examples and guidance on choosing the appropriate method.

PythonThread Safetydesign pattern
0 likes · 5 min read
Implementing the Singleton Pattern in Python: Multiple Approaches
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.

JavaStrategy Patterndesign patterns
0 likes · 24 min read
Master Java Design Patterns: Strategy, Chain, Template, Observer, Factory & Singleton
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.

AsyncFrontendforeach
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 PatternsFactory Pattern
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.

FactoryObserverPHP
0 likes · 7 min read
Common Design Patterns in PHP: Singleton, Factory, Observer, and Adapter
php中文网 Courses
php中文网 Courses
Jan 15, 2024 · Backend Development

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

This article introduces four essential PHP design patterns—Singleton, Factory, Observer, and Adapter—explaining their purpose, providing complete code examples, and showing how they improve code maintainability, extensibility, and flexibility in backend development.

FactoryObserveradapter
0 likes · 7 min read
Common Design Patterns in PHP: Singleton, Factory, Observer, and Adapter