Tagged articles

Design Pattern

133 articles · Page 1 of 2
Tinker Programmer
Tinker Programmer
Jun 25, 2026 · Interview Experience

Singleton Pattern: 6 Implementations, DCL Volatile Pitfall, Spring vs GoF

The article examines the evolution of six singleton implementations in Java, explains why the double‑checked locking pattern requires the volatile keyword to prevent instruction reordering bugs, compares Spring container‑managed singletons with classic GoF singletons, and highlights common pitfalls such as mutable state in singleton beans.

Design PatternSpringVolatile
0 likes · 13 min read
Singleton Pattern: 6 Implementations, DCL Volatile Pitfall, Spring vs GoF
liandk
liandk
Jun 25, 2026 · Fundamentals

Flyweight Pattern Explained with Java Code and Real-World Scenarios

This article introduces the Flyweight design pattern, explains its intrinsic and extrinsic state concepts, presents real-world use cases such as board games and text editors, and provides a complete Java implementation with an abstract piece, concrete piece, factory pool, and test demonstration, highlighting memory savings and potential pitfalls.

Design PatternMemory Optimizationflyweight
0 likes · 5 min read
Flyweight Pattern Explained with Java Code and Real-World Scenarios
liandk
liandk
Jun 19, 2026 · Fundamentals

Bridge Pattern Explained with Code and Real-World Scenarios

This article introduces the Bridge design pattern, explains its purpose of separating two independent dimensions to reduce class explosion, provides practical real‑world examples, and walks through a complete Java implementation with interface, abstract bridge, concrete classes, and a test driver.

Bridge PatternDesign PatternObject-Oriented
0 likes · 5 min read
Bridge Pattern Explained with Code and Real-World Scenarios
liandk
liandk
Jun 14, 2026 · Fundamentals

Factory Method Pattern: Clear Explanation, Code Example, and Real-World Scenarios

This article explains the Factory Method design pattern, illustrates its core principle of separating object creation from business logic, presents everyday analogies, and provides a complete Java implementation with abstract product, concrete products, abstract factory, concrete factories, and a test driver.

DecouplingDesign PatternFactory Method
0 likes · 4 min read
Factory Method Pattern: Clear Explanation, Code Example, and Real-World Scenarios
liandk
liandk
Jun 13, 2026 · Fundamentals

Singleton Pattern: Simple Explanation, Java Code Samples, and Real‑World Use Cases

The article explains the Singleton pattern—ensuring a class has only one global instance—to save resources and avoid conflicts, illustrates two Java implementations (eager and lazy), and lists typical scenarios such as logging utilities, connection pools, global configuration, and exclusive resources.

Design PatternEager InitializationLazy Initialization
0 likes · 4 min read
Singleton Pattern: Simple Explanation, Java Code Samples, and Real‑World Use Cases
samdeepthink
samdeepthink
Jun 4, 2026 · Backend Development

Design and Implementation of an Extension‑Point Mechanism for SaaS Multi‑Tenant Business Differentiation

The article explains how an Extension‑Point mechanism can cleanly isolate tenant‑specific logic in SaaS systems by defining variation interfaces, providing per‑tenant implementations annotated with @Extension, and routing calls at runtime using hierarchical bizCode matching, avoiding tangled if‑else or inheritance explosion.

Design PatternExtension PointSaaS
0 likes · 11 min read
Design and Implementation of an Extension‑Point Mechanism for SaaS Multi‑Tenant Business Differentiation
LuTiao Programming
LuTiao Programming
May 19, 2026 · Fundamentals

Don’t Limit Java Enums to SUCCESS/FAIL – 5 Advanced Enum Techniques Already Used by Top Frameworks

The article reveals five sophisticated ways to leverage Java enums—state‑machine implementation, built‑in strategy pattern, enum‑lambda combos, responsibility‑chain routing, and enum‑Map DSL—showing how major frameworks like Tomcat, Spring Boot and RocketMQ employ them to write cleaner, type‑safe, and easily extensible code.

Design PatternEnumLambda
0 likes · 11 min read
Don’t Limit Java Enums to SUCCESS/FAIL – 5 Advanced Enum Techniques Already Used by Top Frameworks
Architect's Guide
Architect's Guide
Apr 28, 2026 · Backend Development

Tired of Endless if‑else? Try a Rule Engine for Cleaner Logic

The article shows how a growing list of if‑else checks for user eligibility becomes hard to maintain, then walks through designing and implementing a Java rule engine—defining rule abstractions, building an AND/OR executor, and demonstrating usage with concrete examples, while discussing its advantages and drawbacks.

Code ExampleDesign Patternbackend
0 likes · 7 min read
Tired of Endless if‑else? Try a Rule Engine for Cleaner Logic
Senior Xiao Ying
Senior Xiao Ying
Apr 1, 2026 · Backend Development

Mastering the Chain of Responsibility in Spring Boot for Dynamic Workflow Orchestration

This article explains the Chain of Responsibility pattern, outlines its core components, demonstrates a complete Spring Boot order‑processing example with concrete handlers, and shares advanced techniques such as dynamic handler configuration and asynchronous processing, concluding with practical best‑practice tips.

Chain of ResponsibilityDesign PatternDynamic workflow
0 likes · 11 min read
Mastering the Chain of Responsibility in Spring Boot for Dynamic Workflow Orchestration
Cloud Architecture
Cloud Architecture
Mar 10, 2026 · Fundamentals

Why I Won’t Take the Blame: Mastering the Chain of Responsibility Pattern

This article explains the Chain of Responsibility design pattern, shows classic Java implementations, demonstrates its use in Spring Security, provides real‑world examples such as order processing, logging pipelines, and approval workflows, and offers advanced functional and asynchronous techniques along with performance tips and common pitfalls.

Chain of ResponsibilityDesign PatternMiddleware
0 likes · 32 min read
Why I Won’t Take the Blame: Mastering the Chain of Responsibility Pattern
Ray's Galactic Tech
Ray's Galactic Tech
Oct 28, 2025 · Fundamentals

Mastering the Chain of Responsibility Pattern: Clean Task Delegation & Decoupling

This article explains the Chain of Responsibility design pattern, its core concepts, typical use‑cases such as approval workflows and logging, provides step‑by‑step Java examples—including a basic leave‑request system and an advanced builder‑based chain—covers real‑world framework integrations, compares it with other patterns, and lists practical pros, cons, and best‑practice tips.

Chain of ResponsibilityDecouplingDesign Pattern
0 likes · 10 min read
Mastering the Chain of Responsibility Pattern: Clean Task Delegation & Decoupling
Data STUDIO
Data STUDIO
Aug 27, 2025 · Fundamentals

Building a Lightweight State Machine with Python Enum

This article demonstrates how to implement a clear, maintainable state machine for a publishing workflow using Python's Enum type, covering state definitions, forward and backward transitions, validation, entry actions, and visualisation without external dependencies.

Design PatternEnumPython
0 likes · 7 min read
Building a Lightweight State Machine with Python Enum
Architect
Architect
Aug 26, 2025 · Backend Development

Mastering the Chain of Responsibility Pattern for Scalable Backend Validation

This article explains the Chain of Responsibility design pattern, outlines its typical application scenarios, and demonstrates two practical implementations—a multi‑step product creation validation and an expense‑approval workflow—showing how to configure, assemble, and execute handler chains dynamically in Java.

Chain of ResponsibilityDesign Patternjava
0 likes · 20 min read
Mastering the Chain of Responsibility Pattern for Scalable Backend Validation
Code Ape Tech Column
Code Ape Tech Column
Jun 19, 2025 · Fundamentals

Master the Chain of Responsibility Pattern: Concepts, Benefits, and Java Example

This article explains the Chain of Responsibility design pattern, detailing its definition, key characteristics, integration with the Strategy pattern, and practical Java code examples—including abstract interfaces, handlers, context management, and execution flow—illustrating how to build flexible, decoupled processing pipelines for complex business logic.

Chain of ResponsibilityDesign PatternStrategy Pattern
0 likes · 11 min read
Master the Chain of Responsibility Pattern: Concepts, Benefits, and Java Example
Code Ape Tech Column
Code Ape Tech Column
May 20, 2025 · Backend Development

Dynamic Chain of Responsibility in Spring: A Practical Implementation

This article explains how to split a multi‑function OpenAPI endpoint into independent steps using the responsibility‑chain pattern in Spring, detailing the abstract component, context sharing, bean retrieval via ApplicationContext, and a controller that dynamically orders execution through a query parameter, with full code examples.

AOPChain of ResponsibilityDesign Pattern
0 likes · 9 min read
Dynamic Chain of Responsibility in Spring: A Practical Implementation
Selected Java Interview Questions
Selected Java Interview Questions
Apr 29, 2025 · Backend Development

Implementing a Chain of Responsibility for an OpenAPI Interface Using Spring and Custom Components

This article explains how to split a multi‑function OpenAPI interface into independent components using the chain‑of‑responsibility pattern in Spring, detailing the abstract base class, concrete handlers, a shared context, execution order configuration, and a test controller with full code examples.

Chain of ResponsibilityDesign PatternOpenAPI
0 likes · 7 min read
Implementing a Chain of Responsibility for an OpenAPI Interface Using Spring and Custom Components
Java Tech Enthusiast
Java Tech Enthusiast
Mar 7, 2025 · Backend Development

Implementing a Responsibility Chain Pattern with Spring Boot and MyBatis Plus

The article demonstrates how to build a dynamic Chain of Responsibility in a Spring Boot and MyBatis‑Plus application by defining an abstract handler, implementing concrete @Component beans that modify a shared Lombok‑based context, retrieving them via an ApplicationContext‑aware proxy utility, and invoking them in a client‑specified order through a REST endpoint, while suggesting LiteFlow as a production alternative.

Design PatternREST APISpring Boot
0 likes · 9 min read
Implementing a Responsibility Chain Pattern with Spring Boot and MyBatis Plus
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.

Design PatternPythondecorator
0 likes · 7 min read
Implementing a Python Singleton with Decorators
Top Architecture Tech Stack
Top Architecture Tech Stack
Feb 20, 2025 · Backend Development

Implementing the Chain of Responsibility Pattern for Product Validation and Workflow Approval in Java

This article explains the Chain of Responsibility design pattern, demonstrates its application in multi‑step product validation and expense‑approval workflows with detailed Java code, configuration handling, Spring bean injection, and discusses its advantages and drawbacks.

Chain of ResponsibilityDesign PatternSpring
0 likes · 21 min read
Implementing the Chain of Responsibility Pattern for Product Validation and Workflow Approval in Java
Selected Java Interview Questions
Selected Java Interview Questions
Jan 14, 2025 · Backend Development

Understanding the Chain of Responsibility Pattern and Its Combination with Strategy Pattern in Java

This article explains the Chain of Responsibility design pattern, its core concepts, characteristics, and problems it solves, then demonstrates how to combine it with the Strategy pattern through detailed Java code examples that illustrate a product‑up‑shelf validation workflow and a generic request‑handling scenario.

Chain of ResponsibilityDesign PatternStrategy Pattern
0 likes · 16 min read
Understanding the Chain of Responsibility Pattern and Its Combination with Strategy Pattern in Java
Code Ape Tech Column
Code Ape Tech Column
Dec 27, 2024 · Backend Development

Object Pool Pattern: Principles, Apache Commons Pool Implementation, and Practical Use Cases

This article explains the object pool design pattern, its working mechanism, advantages and disadvantages, and provides step‑by‑step Java code using Apache Commons Pool along with real‑world examples for web servers and game development to improve performance and resource management.

Design Patternapache-commons-poolobject-pool
0 likes · 14 min read
Object Pool Pattern: Principles, Apache Commons Pool Implementation, and Practical Use Cases
Architect's Guide
Architect's Guide
Nov 14, 2024 · Backend Development

Implementing the Chain of Responsibility Pattern for Product Validation in Java

This article explains the Chain of Responsibility design pattern, demonstrates its application in a product creation workflow with concrete Java code, shows how to configure and assemble handlers dynamically using Spring, and discusses the pattern's advantages, drawbacks, and testing scenarios.

Chain of ResponsibilityDesign PatternSpring
0 likes · 20 min read
Implementing the Chain of Responsibility Pattern for Product Validation in Java
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.

Design PatternMetaclassThread Safety
0 likes · 10 min read
Implementing the Singleton Pattern in Python: Multiple Approaches and Thread Safety
Java Tech Enthusiast
Java Tech Enthusiast
Sep 28, 2024 · Backend Development

Avoiding Low Cohesion Bugs by Centralizing Repayment Logic in Java

The article explains how adding a new reducePrincipal field to the RepayPlan class caused existing interfaces to miscalculate remaining principal, and demonstrates fixing the low‑cohesion bug by centralizing the updated calculation in a RepaymentCalculator utility so future changes occur in one place.

Code RefactoringDesign Patternjava
0 likes · 4 min read
Avoiding Low Cohesion Bugs by Centralizing Repayment Logic in Java
Java Architect Essentials
Java Architect Essentials
Sep 24, 2024 · Backend Development

Understanding the State Pattern and Implementing Order Workflow with Spring State Machine

This article explains the State design pattern, demonstrates its Java implementation with example code, introduces Spring State Machine concepts, and provides a complete step‑by‑step guide to building and testing an order status workflow using Spring State Machine, including configuration, listeners, services, and a controller.

Design PatternOrder WorkflowSpring
0 likes · 13 min read
Understanding the State Pattern and Implementing Order Workflow with Spring State Machine
Lobster Programming
Lobster Programming
Sep 12, 2024 · Backend Development

Mastering the Chain of Responsibility Pattern in Java Spring: A Step‑by‑Step Guide

This article explains the Chain of Responsibility design pattern using a real‑world iron‑chain analogy, then demonstrates a complete Java Spring implementation for order validation, including interface definition, abstract base class, concrete handlers, Spring configuration, service, and controller code.

Chain of ResponsibilityDesign Patternjava
0 likes · 6 min read
Mastering the Chain of Responsibility Pattern in Java Spring: A Step‑by‑Step Guide
Top Architect
Top Architect
Sep 3, 2024 · Backend Development

Design and Implementation of a General Asynchronous Processing SDK for Java Backend

This article introduces a reusable asynchronous processing SDK for Java backend systems, explaining its purpose, advantages, underlying principles, component choices, design patterns, database schema, configuration options, usage instructions, and best‑practice notes, while providing complete code snippets and deployment details.

Design PatternKafkaTransaction
0 likes · 13 min read
Design and Implementation of a General Asynchronous Processing SDK for Java Backend
Top Architect
Top Architect
Jul 31, 2024 · Backend Development

Design and Implementation of a Generic Asynchronous Processing SDK for Spring Applications

This article introduces a Spring‑based asynchronous processing SDK that leverages annotations, transaction event listeners, Kafka, XXL‑Job, and a dedicated database to achieve non‑blocking execution, fault tolerance, and eventual consistency while preserving transaction integrity and providing a clear configuration and usage guide.

DatabaseDesign PatternKafka
0 likes · 12 min read
Design and Implementation of a Generic Asynchronous Processing SDK for Spring Applications
Architecture Digest
Architecture Digest
Jul 30, 2024 · Fundamentals

Understanding the Chain of Responsibility Design Pattern with Java Examples

This article explains the Chain of Responsibility design pattern, its typical use cases, demonstrates a flawed nested‑if implementation for a multi‑level game, and then shows step‑by‑step refactorings—including an abstract handler, concrete handlers, and a factory‑based dynamic chain—using Java code examples.

Chain of ResponsibilityDesign Patternjava
0 likes · 10 min read
Understanding the Chain of Responsibility Design Pattern with Java Examples
Architect's Guide
Architect's Guide
May 26, 2024 · Backend Development

Applying Abstract Methods, Anonymous Inner Classes, and Future Pattern for Highly Abstracted Java Service Design

The article demonstrates how to achieve high abstraction in Java by using abstract methods overridden by subclasses, passing behavior through anonymous inner classes, and implementing an asynchronous Future pattern with listeners to handle request results, providing complete code examples for each technique.

Abstract ClassAsynchronousDesign Pattern
0 likes · 8 min read
Applying Abstract Methods, Anonymous Inner Classes, and Future Pattern for Highly Abstracted Java Service Design
Bilibili Tech
Bilibili Tech
May 7, 2024 · Frontend Development

Design and Implementation of a Unified Front-End Request Library Based on Middleware Pattern

Bilibili created a unified front‑end request library using a Koa‑style middleware “onion” architecture—ConfigCtrl, AssembleCtrl, and RequestCtrl—to standardize error handling, cut code redundancy, improve performance, and provide consistent, extensible API calls across SSR/CSR, Vue2/Vue3, and in‑app H5 environments.

Design PatternFrontendHTTP
0 likes · 16 min read
Design and Implementation of a Unified Front-End Request Library Based on Middleware Pattern
php Courses
php Courses
Apr 10, 2024 · Fundamentals

What Is the State Pattern? Explanation and PHP Implementation Example

The article introduces the State design pattern as a behavioral pattern that lets objects change their behavior when their internal state changes, compares it with the Strategy pattern, and provides a detailed PHP example illustrating its components and usage.

Design PatternState Patternbehavioral pattern
0 likes · 5 min read
What Is the State Pattern? Explanation and PHP Implementation Example
Selected Java Interview Questions
Selected Java Interview Questions
Apr 9, 2024 · Backend Development

Applying the Chain of Responsibility Pattern for Multi‑Level Product Validation and Workflow in Java

This article explains the Chain of Responsibility design pattern, demonstrates its use for multi‑step product validation and a reimbursement workflow in Java with Spring, provides UML diagrams, configuration handling, concrete handler implementations, client execution code, and discusses the pattern’s advantages and drawbacks.

Chain of ResponsibilityDesign PatternSpring
0 likes · 18 min read
Applying the Chain of Responsibility Pattern for Multi‑Level Product Validation and Workflow in Java
FunTester
FunTester
Mar 5, 2024 · Backend Development

Building a Lightweight Java Object Pool Without Commons‑Pool2

This article walks through the design and implementation of a simple, thread‑safe object pool in Java using a LinkedBlockingQueue, explains the underlying concepts such as factory pattern and queue trimming, and provides a complete code example with a test script and output analysis.

Design Patternbackendconcurrency
0 likes · 7 min read
Building a Lightweight Java Object Pool Without Commons‑Pool2
Architect
Architect
Feb 15, 2024 · Backend Development

Mastering State Patterns with Spring State Machine: From Theory to Order Workflow

This article explains the classic State design pattern, demonstrates a traffic‑light example, compares Spring State Machine with COLA, and walks through building a complete order‑status workflow in Spring Boot using enums, configuration, listeners, services, and a test controller, while highlighting trade‑offs and alternatives.

Design PatternOrder WorkflowSpring
0 likes · 14 min read
Mastering State Patterns with Spring State Machine: From Theory to Order Workflow
政采云技术
政采云技术
Jan 16, 2024 · Fundamentals

Understanding Finite State Machines: Definitions, Usage, Advantages, and Their Relation to Domain‑Driven Design

This article explains what a finite state machine (FSM) is, illustrates it with a car transmission example, outlines its components and diagramming, discusses its technical pros and cons, explores business benefits, and examines how state machines relate to domain‑driven design.

Design PatternDomain-Driven DesignFinite State Machine
0 likes · 13 min read
Understanding Finite State Machines: Definitions, Usage, Advantages, and Their Relation to Domain‑Driven Design
php Courses
php Courses
Dec 9, 2023 · Backend Development

Using Value Objects in PHP 8.1/8.2 to Improve Code Quality

The article explains how the Value Object pattern, combined with PHP 8.1/8.2 features like readonly properties and named arguments, can eliminate primitive‑type validation duplication, prevent parameter‑order mistakes, and ensure immutability, thereby making PHP code more robust, maintainable, and self‑documenting.

Design PatternImmutablePHP
0 likes · 12 min read
Using Value Objects in PHP 8.1/8.2 to Improve Code Quality
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.

Design PatternPHPbest practices
0 likes · 5 min read
Best Practices and Performance Optimization for the Singleton Pattern in PHP
Selected Java Interview Questions
Selected Java Interview Questions
Nov 12, 2023 · Backend Development

Implementing the Chain of Responsibility Pattern for Login Risk Management in Java

This article explains the Chain of Responsibility design pattern and demonstrates how to apply it in a Java backend to evaluate login risk factors such as password errors, unusual login times, IP whitelist violations, and abnormal login locations, providing full code examples and execution flow.

Chain of ResponsibilityDesign PatternLogin Risk
0 likes · 16 min read
Implementing the Chain of Responsibility Pattern for Login Risk Management in Java
DaTaobao Tech
DaTaobao Tech
Nov 1, 2023 · Fundamentals

Understanding the Chain of Responsibility Design Pattern

The Chain of Responsibility pattern links a series of handler objects so that a request can be passed along until one processes it, decoupling sender and receiver, supporting dynamic composition, runtime flexibility, and the Open/Closed principle, as illustrated by a Java leave‑approval workflow.

Chain of ResponsibilityCode ExampleDesign Pattern
0 likes · 12 min read
Understanding the Chain of Responsibility Design Pattern
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.

Design PatternFactory MethodObject Factory
0 likes · 7 min read
Understanding the Object Factory Design Pattern with Python Examples
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 27, 2023 · Backend Development

Applying the Chain of Responsibility Pattern in Spring MVC Interceptors

This article explains how the Chain of Responsibility design pattern is implemented within Spring MVC interceptors, detailing the request flow, interceptor lifecycle methods, and practical differences from the classic GoF definition, while also exploring other typical use cases of the pattern.

Chain of ResponsibilityDesign PatternInterceptor
0 likes · 10 min read
Applying the Chain of Responsibility Pattern in Spring MVC Interceptors
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 24, 2023 · Backend Development

Applying the Chain of Responsibility Design Pattern in Spring MVC Interceptors

This article explains how the Chain of Responsibility design pattern is employed within Spring MVC interceptors, detailing the interceptor lifecycle, code implementation, differences from the classic GoF definition, and broader use cases such as authentication, logging, and order processing.

Chain of ResponsibilityDesign PatternInterceptor
0 likes · 10 min read
Applying the Chain of Responsibility Design Pattern in Spring MVC Interceptors
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.

Design PatternPHPbackend development
0 likes · 6 min read
Best Practices and Performance Optimization of the Singleton Pattern in PHP
vivo Internet Technology
vivo Internet Technology
Sep 20, 2023 · Backend Development

Chain of Responsibility Pattern: Implementation and Applications in Open Source Frameworks

The article explains the Chain of Responsibility design pattern, compares its two implementation styles—chain‑driven and processor‑self‑driven—and demonstrates how open‑source frameworks such as Spring Interceptor, Servlet Filter, Dubbo, and Sentinel employ the pattern to achieve low coupling, high extensibility, and flexible request processing.

Chain of ResponsibilityDesign PatternDubbo
0 likes · 19 min read
Chain of Responsibility Pattern: Implementation and Applications in Open Source Frameworks
Test Development Learning Exchange
Test Development Learning Exchange
Jul 7, 2023 · Fundamentals

Understanding the Object Factory Design Pattern with Python Examples

This article explains the Object Factory design pattern, its benefits such as decoupling, extensibility, and centralized instance management, and demonstrates five practical Python examples covering basic product creation, configuration‑driven factories, logger factories, singleton factories, and object caching factories.

Design PatternFactory MethodObject Factory
0 likes · 7 min read
Understanding the Object Factory Design Pattern with Python Examples
Code Ape Tech Column
Code Ape Tech Column
Jun 30, 2023 · Backend Development

Applying the Service Locator Pattern to Decouple File Parsers in Spring

This article demonstrates how to replace tightly‑coupled if‑else or switch‑case parser selection with the Service Locator Pattern in a Spring Java application, enabling easy addition of new file‑type parsers without modifying client code and adhering to the open‑closed principle.

DecouplingDesign PatternParser
0 likes · 8 min read
Applying the Service Locator Pattern to Decouple File Parsers in Spring
Programmer DD
Programmer DD
May 24, 2023 · Fundamentals

Mastering the Chain of Responsibility Pattern: From Flawed IF Chains to Elegant Handlers

This article explains the Chain of Responsibility design pattern, shows why naïve nested if‑statements are problematic, demonstrates a step‑by‑step refactor using linked handlers, introduces an abstract handler hierarchy, and finally presents a factory‑based dynamic configuration for scalable request processing in Java.

Chain of ResponsibilityDesign Patternrefactoring
0 likes · 12 min read
Mastering the Chain of Responsibility Pattern: From Flawed IF Chains to Elegant Handlers
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.

Design PatternMetaclassThread Safety
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.

Design PatternMetaclassThread Safety
0 likes · 10 min read
Implementing the Singleton Pattern in Python: Modules, Decorators, Classes, __new__ Method, and Metaclasses
Selected Java Interview Questions
Selected Java Interview Questions
Mar 17, 2023 · Fundamentals

Double‑Checked Locking, Static Inner Class, and Enum Singleton Implementations in Java

This article explains three Java singleton implementations—double‑checked locking with volatile, static inner‑class holder, and enum singleton—detailing their thread‑safety, lazy initialization, and how they prevent issues such as instruction reordering, serialization, and reflection attacks.

Design PatternEnumconcurrency
0 likes · 14 min read
Double‑Checked Locking, Static Inner Class, and Enum Singleton Implementations in Java
Architecture Digest
Architecture Digest
Feb 18, 2023 · Fundamentals

Understanding the Factory Pattern: Simple Factory, Factory Method, and Abstract Factory with Real-world Examples

This article explains the three main factory design patterns—Simple Factory, Factory Method, and Abstract Factory—detailing their concepts, typical use cases such as document parsing and browser automation, and providing complete Java‑style code examples to illustrate each pattern's implementation and benefits.

Design PatternFactory PatternObject-Oriented
0 likes · 12 min read
Understanding the Factory Pattern: Simple Factory, Factory Method, and Abstract Factory with Real-world Examples
DaTaobao Tech
DaTaobao Tech
Feb 1, 2023 · Fundamentals

Template Method Design Pattern: Concepts, Implementation, and Usage

The Template Method pattern defines an algorithm’s fixed skeleton in an abstract class while delegating variable steps to subclasses via abstract or hook methods, enabling reusable, maintainable code through a final template method, concrete implementations, and practical examples such as online shopping and JDK’s AbstractList, with benefits of encapsulation and extensibility but potential complexity from inheritance.

Design PatternSoftware Engineeringcode reuse
0 likes · 10 min read
Template Method Design Pattern: Concepts, Implementation, and Usage
Code Ape Tech Column
Code Ape Tech Column
Jan 31, 2023 · Backend Development

Applying the Service Locator Pattern to Decouple File Parsers in Java

This article explains how to replace tightly‑coupled if‑else or switch‑case logic for selecting file parsers (JSON, CSV, XML) with a Service Locator Pattern using Spring's ServiceLocatorFactoryBean, demonstrating a clean, extensible solution that follows the Open/Closed principle.

Design PatternService LocatorSpring
0 likes · 8 min read
Applying the Service Locator Pattern to Decouple File Parsers in Java
Ubiquitous Tech
Ubiquitous Tech
Jan 28, 2023 · Backend Development

Decoupling Java Business Logic with Spring Event: A Hands‑On Example

Learn how to use Spring's Application Event mechanism to separate main and sub‑processes in Java applications, covering custom event and listener creation, publishing events, abstract base event design, singleton manager, and a real‑world order‑cancellation SMS notification case.

DecouplingDesign PatternSpring
0 likes · 10 min read
Decoupling Java Business Logic with Spring Event: A Hands‑On Example
php Courses
php Courses
Jan 17, 2023 · Backend Development

Implementing the Chain of Responsibility Design Pattern in PHP with Hyperf

This article demonstrates how to implement the Chain of Responsibility design pattern in PHP using the Hyperf framework, detailing the file structure, core classes such as IndexController, HandlerInterface, AbstractHandler, and concrete handlers, and includes a unit test example to verify the workflow.

Chain of ResponsibilityDesign PatternHyperf
0 likes · 7 min read
Implementing the Chain of Responsibility Design Pattern in PHP with Hyperf
Code Ape Tech Column
Code Ape Tech Column
Dec 26, 2022 · Backend Development

Applying the Chain of Responsibility Pattern for Multi‑Level Product Validation and Workflow in Java

This article explains the Chain of Responsibility design pattern, demonstrates its use in multi‑step product creation validation and expense‑approval workflows with concrete Java/Spring code, and discusses configuration, dynamic composition, advantages, drawbacks, and testing scenarios.

Chain of ResponsibilityDesign PatternSpring
0 likes · 21 min read
Applying the Chain of Responsibility Pattern for Multi‑Level Product Validation and Workflow in Java
Top Architect
Top Architect
Nov 23, 2022 · Backend Development

Chain of Responsibility Pattern in Java: Design, Implementation, and Practical Example

This article explains the Chain of Responsibility design pattern, demonstrates its use for request validation and processing in Java backend applications, provides complete code examples—including abstract handler, concrete validators, business logic, and a test harness—while discussing its advantages, drawbacks, and real‑world analogues such as servlet filters.

Chain of ResponsibilityDesign Patternfilter
0 likes · 11 min read
Chain of Responsibility Pattern in Java: Design, Implementation, and Practical Example
Sohu Tech Products
Sohu Tech Products
Oct 19, 2022 · Fundamentals

Understanding the Observer Pattern with Go Code Examples

This article explains the Observer (publish‑subscribe) pattern, illustrates it with a humorous dialogue, provides complete Go interface and struct implementations for subjects and observers, shows sample client code and output, and discusses practical refactoring using the pattern for configuration changes.

Design PatternGoObserver Pattern
0 likes · 8 min read
Understanding the Observer Pattern with Go Code Examples
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.

Design PatternFrontendJavaScript
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.

Design PatternThread Safetyjava
0 likes · 7 min read
Various Singleton Pattern Implementations in Java
Huolala Tech
Huolala Tech
Sep 13, 2022 · Frontend Development

Mastering the Chain of Responsibility Pattern: From Classic Story to Front‑End Code

This article explains the Chain of Responsibility design pattern, illustrates it with a historical Three Kingdoms story, shows progressive refactorings from procedural code to abstract handlers in TypeScript, and demonstrates practical front‑end scenarios such as flexible location retrieval.

Chain of ResponsibilityDesign PatternOOP
0 likes · 10 min read
Mastering the Chain of Responsibility Pattern: From Classic Story to Front‑End Code
Python Programming Learning Circle
Python Programming Learning Circle
Aug 10, 2022 · Fundamentals

Implementing Thread‑Safe Singleton Pattern in Python

This article explains the purpose of the Singleton design pattern, demonstrates multiple Python implementations—including module‑level singletons, decorators, class‑based approaches, __new__ method, and metaclass techniques—and shows how to add thread‑safety with locks to ensure only one instance exists across concurrent executions.

Design PatternLockMetaclass
0 likes · 10 min read
Implementing Thread‑Safe Singleton Pattern in Python
macrozheng
macrozheng
Aug 5, 2022 · Backend Development

Transform IF Chains into Scalable Java: Master the Responsibility Pattern

This article explains the Chain of Responsibility design pattern in Java, illustrating its use for multi‑level approval workflows during high‑traffic events, provides step‑by‑step code implementations, refactors naive IF logic into modular link classes, and demonstrates testing, highlighting benefits for clean, extensible backend architecture.

Chain of ResponsibilityDesign Patternbackend development
0 likes · 21 min read
Transform IF Chains into Scalable Java: Master the Responsibility Pattern
Architect's Tech Stack
Architect's Tech Stack
Jul 19, 2022 · Backend Development

Asynchronous Excel Import with Thread Pool and AOP in Java

This article explains how to handle large Excel uploads in Java by offloading parsing and validation to a thread pool, using the Template Method pattern to reduce boilerplate, and finally applying a custom AOP annotation to manage logging, error handling, and asynchronous execution in a clean, reusable way.

AOPDesign PatternThread Pool
0 likes · 10 min read
Asynchronous Excel Import with Thread Pool and AOP in Java
Java Backend Technology
Java Backend Technology
Jun 16, 2022 · Fundamentals

Mastering the Chain of Responsibility Pattern: From Pitfalls to Clean Implementations

This article explains the Chain of Responsibility design pattern, illustrates common misuse with a multi‑if game‑level example, and then shows step‑by‑step refactorings—including linked handlers, an abstract base class, a factory and enum‑based configuration—to produce clean, extensible Java code.

Chain of ResponsibilityDesign Patternrefactoring
0 likes · 12 min read
Mastering the Chain of Responsibility Pattern: From Pitfalls to Clean Implementations
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.

Design PatternThread Safetysingleton
0 likes · 10 min read
Elegant and Efficient Singleton Implementations in Java
Python Programming Learning Circle
Python Programming Learning Circle
Mar 31, 2022 · Fundamentals

Understanding Python Objects and Class Decorators

This article explains Python's object model, showing that numbers, strings, lists, tuples, sets, dictionaries, functions, classes, and modules are all objects, and then thoroughly introduces decorators, describing their design‑pattern nature, typical uses such as logging and profiling, and demonstrates class‑decorator implementation with practical examples.

Design PatternObjectsclass-decorator
0 likes · 3 min read
Understanding Python Objects and Class Decorators
IT Services Circle
IT Services Circle
Mar 18, 2022 · Fundamentals

Understanding Meyers' Singleton in C++: Why Static Local Variables Matter

This article explains the proper C++ singleton implementation known as Meyers' Singleton, showing how a static local variable inside a getInstance() function ensures thread‑safe lazy initialization, avoids static‑initialization‑order problems, and handles inheritance correctly.

C++Design PatternMeyers Singleton
0 likes · 6 min read
Understanding Meyers' Singleton in C++: Why Static Local Variables Matter
政采云技术
政采云技术
Mar 8, 2022 · Frontend Development

Understanding and Using Decorators in JavaScript (Frontend Development)

This article introduces JavaScript decorators, explains their relation to the decorator design pattern, shows how to configure Babel for decorator support, demonstrates class and method decorator syntax with detailed code examples, and discusses practical usage scenarios and execution order in modern front‑end projects.

BabelDesign Patternclass
0 likes · 13 min read
Understanding and Using Decorators in JavaScript (Frontend Development)
Top Architect
Top Architect
Sep 15, 2021 · Fundamentals

Avoiding Null Pointer Checks: When to Use Null, Assertions, and the Null Object Pattern

The article explains why excessive null‑checking in Java code is problematic, distinguishes between null as a valid response and null as an error, and offers practical techniques such as returning empty collections, using assertions, throwing exceptions, and applying the Null Object pattern to write cleaner, safer code.

Design Patternbackendbest-practices
0 likes · 7 min read
Avoiding Null Pointer Checks: When to Use Null, Assertions, and the Null Object Pattern
macrozheng
macrozheng
Jul 19, 2021 · Fundamentals

Mastering the Chain of Responsibility Pattern in Java: A Practical Guide

This article explains the Chain of Responsibility design pattern, outlines its four roles, demonstrates a real‑world Java implementation for encrypted request handling, and shows how to build an extensible processing chain that improves code readability and maintainability.

Chain of ResponsibilityDesign Patternbackend development
0 likes · 10 min read
Mastering the Chain of Responsibility Pattern in Java: A Practical Guide
Senior Brother's Insights
Senior Brother's Insights
Jun 23, 2021 · Fundamentals

Mastering the Builder Pattern: From Theory to Real Java Code

This article explains the Builder design pattern, detailing its definition, roles, Java implementation with code examples, practical use cases, advantages and drawbacks, comparison with the Factory pattern, and a real‑world illustration using JDK’s StringBuilder, helping developers understand when and how to apply it.

BuilderDesign Patternsoftware-architecture
0 likes · 14 min read
Mastering the Builder Pattern: From Theory to Real Java Code
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jun 6, 2021 · Fundamentals

Understanding the Chain of Responsibility Design Pattern with Real‑World Stories and Java Implementations

This article explains the Chain of Responsibility design pattern by linking a historical story of Guan Yu’s five passes with an OA leave‑approval workflow, provides a clear definition, discusses its pros and cons, and presents comprehensive Java code examples illustrating abstract handlers, concrete handlers, and client usage.

Chain of ResponsibilityDesign PatternOO Design
0 likes · 12 min read
Understanding the Chain of Responsibility Design Pattern with Real‑World Stories and Java Implementations
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 20, 2021 · Backend Development

Template Method Design Pattern in Java: Theory, Implementation, and Framework Applications

This article explains the Template Method design pattern, illustrating its algorithm skeleton and step customization with Java code examples, and demonstrates real‑world applications in Spring, MyBatis, and other backend frameworks, highlighting advantages, drawbacks, and practical implementation details.

Design PatternMyBatisSpring
0 likes · 12 min read
Template Method Design Pattern in Java: Theory, Implementation, and Framework Applications
Nullbody Notes
Nullbody Notes
Feb 21, 2021 · Fundamentals

Implementing the Chain of Responsibility Pattern in Go

This article explains the Chain of Responsibility design pattern, illustrates it with a company expense‑approval scenario, and provides complete Go code—including an interface, Staff, Manager, and CEO structs—showing how to build a flexible, extensible approval chain.

Chain of ResponsibilityDesign PatternGo
0 likes · 6 min read
Implementing the Chain of Responsibility Pattern in Go
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Feb 18, 2021 · Fundamentals

Comprehensive Guide to the Singleton Pattern in Java: Implementations, Pitfalls, and the Secure Enum Solution

This article explains various Java singleton implementations—including eager, lazy, double‑checked locking, static inner class, and enum—demonstrates their thread‑safety issues, shows how reflection and serialization can break them, and presents the enum approach as a truly safe solution.

Design PatternEnumThread Safety
0 likes · 11 min read
Comprehensive Guide to the Singleton Pattern in Java: Implementations, Pitfalls, and the Secure Enum Solution
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Nov 20, 2020 · Fundamentals

Understanding the Chain of Responsibility Design Pattern with a Historical Example

This article introduces the Chain of Responsibility design pattern, explains its motivation through a Qing‑dynasty travel scenario, outlines class design and UML, provides complete Java code examples, demonstrates extensibility, and discusses broader applications in modern software systems.

Chain of ResponsibilityDesign PatternObject-Oriented
0 likes · 12 min read
Understanding the Chain of Responsibility Design Pattern with a Historical Example