Tag

Strategy Pattern

1 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 18, 2025 · Fundamentals

Strategy Design Pattern in Java: Definition, Structure, Example, and Refactoring

This article explains the behavioral Strategy design pattern, describes its definition and structure, demonstrates a real‑world e‑commerce discount scenario with both a tangled if‑else implementation and a clean refactoring using Java interfaces, concrete strategy classes, a context, and a client, and finally discusses its advantages and drawbacks.

JavaStrategy Patterndesign patterns
0 likes · 9 min read
Strategy Design Pattern in Java: Definition, Structure, Example, and Refactoring
macrozheng
macrozheng
Mar 13, 2025 · Backend Development

Mastering the Strategy Pattern in Spring Boot: Clean, Extensible Code with Real Examples

This article walks through the concept and practical implementation of the Strategy design pattern in Spring Boot, showing how to define operation interfaces, create concrete strategy classes, use factories and Spring's IoC container for clean, maintainable, and extensible backend code.

Backend DevelopmentJavaSpringBoot
0 likes · 9 min read
Mastering the Strategy Pattern in Spring Boot: Clean, Extensible Code with Real Examples
php中文网 Courses
php中文网 Courses
Feb 17, 2025 · Backend Development

Applying Strategy and Chain of Responsibility Patterns in Symfony: Deep Dive with PHP Code Examples

This article explains how the Strategy and Chain of Responsibility design patterns are applied within the Symfony framework, providing detailed PHP code examples, discussing their integration in core components, and highlighting the architectural benefits such as flexibility, loose coupling, and maintainability.

Backend DevelopmentChain of ResponsibilityPHP
0 likes · 7 min read
Applying Strategy and Chain of Responsibility Patterns in Symfony: Deep Dive with PHP Code Examples
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 17, 2025 · Backend Development

Chain of Responsibility Pattern in Java with Strategy Pattern Integration

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 in Java using Spring, complete with detailed code examples and execution flow.

Chain of ResponsibilityJavaSpring
0 likes · 16 min read
Chain of Responsibility Pattern in Java with Strategy Pattern Integration
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 PatternJava
0 likes · 16 min read
Understanding the Chain of Responsibility Pattern and Its Combination with Strategy Pattern in Java
Selected Java Interview Questions
Selected Java Interview Questions
Oct 27, 2024 · Backend Development

Optimizing Discount Logic with Factory and Strategy Patterns in Java

This article demonstrates how to replace bulky if‑else discount handling in a SpringBoot shopping service with a clean combination of strategy and factory patterns, providing extensible, maintainable code for various user types and product discounts.

Factory PatternJavaSpringBoot
0 likes · 13 min read
Optimizing Discount Logic with Factory and Strategy Patterns in Java
Architect's Guide
Architect's Guide
Aug 19, 2024 · Fundamentals

Applying the Strategy Pattern with Simple Factory in a Java Backend Service

This article explains how to use the Strategy pattern combined with a simple factory in a Spring‑based Java backend, showing interface definition, multiple arithmetic strategy implementations, a factory that registers them in a map, a service that selects a strategy at runtime, and a REST controller for testing.

FactoryJavaSpring
0 likes · 6 min read
Applying the Strategy Pattern with Simple Factory in a Java Backend Service
php中文网 Courses
php中文网 Courses
Aug 14, 2024 · Fundamentals

Understanding the Strategy Design Pattern: Principles, Benefits, and PHP Implementations

This article explains the Strategy design pattern, its alignment with SOLID principles such as Single Responsibility and Open/Closed, and demonstrates how it improves code maintainability, reusability, testability, and flexibility through clear PHP examples for payments, sorting, discounts, and shipping.

Code ReusabilityPHPSOLID
0 likes · 11 min read
Understanding the Strategy Design Pattern: Principles, Benefits, and PHP Implementations
Architecture Digest
Architecture Digest
Aug 12, 2024 · Fundamentals

Replacing If‑Else: Cleaner Code Strategies and Refactoring Techniques

This article explains why traditional if‑else statements often lead to complex, hard‑to‑maintain code and demonstrates several techniques—such as removing unnecessary else blocks, using fast returns, guard clauses, dictionary‑based dispatch, and the strategy pattern—to replace if‑else with cleaner, more extensible designs.

Strategy Patterndesign patternsguard clauses
0 likes · 6 min read
Replacing If‑Else: Cleaner Code Strategies and Refactoring Techniques
php中文网 Courses
php中文网 Courses
Aug 9, 2024 · Backend Development

Applying the Strategy Design Pattern with the Open/Closed Principle in Laravel

This article explains how to apply the Strategy design pattern together with the Open‑Closed Principle in Laravel, showing step‑by‑step code examples for defining a strategy interface, implementing concrete payment strategies, and creating a context class that dynamically selects the appropriate payment gateway while keeping the system extensible and maintainable.

Backend DevelopmentLaravelPHP
0 likes · 12 min read
Applying the Strategy Design Pattern with the Open/Closed Principle in Laravel
Lobster Programming
Lobster Programming
Jul 13, 2024 · Backend Development

Simplify Multi‑Channel Order Processing with Template, Factory & Strategy Patterns

This article demonstrates how to use the Template Method, Factory Method, and Strategy patterns in a Java Spring e‑commerce fulfillment system to clearly separate channel‑specific order handling, improve code maintainability, and enable rapid addition of new order types.

Factory MethodJavaSpring
0 likes · 6 min read
Simplify Multi‑Channel Order Processing with Template, Factory & Strategy Patterns
Selected Java Interview Questions
Selected Java Interview Questions
Jul 1, 2024 · Fundamentals

Java Design Patterns: Strategy, Factory, Singleton, Proxy, Observer, Template Method, Adapter and More

This article provides a comprehensive introduction to common Java design patterns—including Strategy, Factory, Singleton, Proxy, Observer, Template Method, and Adapter—explaining their concepts, typical use‑cases, and complete code implementations with Spring Boot integration for practical application development.

Factory PatternJavaStrategy Pattern
0 likes · 20 min read
Java Design Patterns: Strategy, Factory, Singleton, Proxy, Observer, Template Method, Adapter and More
Code Ape Tech Column
Code Ape Tech Column
Jun 20, 2024 · Backend Development

Implementation of Contract Signing Process Using Chain of Responsibility, Strategy, and Composite Patterns in Java

This article explains a Java-based contract signing system that combines the Chain of Responsibility, Composite, and Strategy design patterns within a Spring Boot application, detailing the processing flow, project structure, key code implementations, and how annotations and enums simplify bean injection.

Backend DevelopmentChain of ResponsibilityJava
0 likes · 16 min read
Implementation of Contract Signing Process Using Chain of Responsibility, Strategy, and Composite Patterns in Java
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
Selected Java Interview Questions
Selected Java Interview Questions
May 12, 2024 · Backend Development

Optimizing Contract Signing with Strategy, Chain of Responsibility, and Composite Patterns in Java

This article explains how to improve a Java Spring Boot contract signing workflow by combining the Strategy pattern, Chain of Responsibility, and Composite patterns, detailing the process steps, project structure, code implementations, custom annotations, and dynamic bean injection to achieve a flexible and maintainable solution.

Chain of ResponsibilityJavaSpring Boot
0 likes · 13 min read
Optimizing Contract Signing with Strategy, Chain of Responsibility, and Composite Patterns in Java
Architect
Architect
Feb 5, 2024 · Backend Development

Applying the Strategy Pattern with Simple Factory in a Spring Boot Application

This article demonstrates how to apply the Strategy pattern combined with a simple factory in a Spring Boot application, showing interface definition, multiple arithmetic strategy implementations, a factory that registers beans, a service invoking strategies via a map, and a REST controller for testing, highlighting extensibility.

FactoryJavaSpring Boot
0 likes · 8 min read
Applying the Strategy Pattern with Simple Factory in a Spring Boot Application
DeWu Technology
DeWu Technology
Jan 24, 2024 · Backend Development

Dynamic Parameter Handling with Spring SpEL and Strategy Pattern

The article demonstrates replacing fragile if‑else channel logic with a Strategy pattern and Spring Expression Language, storing parameter mappings in a database so that new payment channels or Excel formats can be added simply by configuring SpEL expressions, achieving a flexible, maintainable, data‑driven solution.

JavaSPELSpring
0 likes · 17 min read
Dynamic Parameter Handling with Spring SpEL and Strategy Pattern
DaTaobao Tech
DaTaobao Tech
Jan 15, 2024 · Backend Development

Refactoring Java Sale‑Type Parsing: From Simple Method to Design Patterns

Starting from a basic Java method that maps a sale‑type string to an integer, the article incrementally refactors the code by applying null‑safe utilities, constants, static methods, ternary/Optional expressions, enums with lookup maps, a combined relation enum, and finally a Strategy pattern with a container, illustrating how each step improves safety, readability, extensibility, and testability.

JavaOptionalStrategy Pattern
0 likes · 13 min read
Refactoring Java Sale‑Type Parsing: From Simple Method to Design Patterns
Selected Java Interview Questions
Selected Java Interview Questions
Jan 11, 2024 · Backend Development

Design and Implementation of a Flexible Data Permission System in Java

This article presents a comprehensive design and implementation of a customizable data permission framework for Java backend applications, detailing the requirements, rule table structure, strategy pattern handling, custom annotations, AOP integration, and practical examples with full source code snippets.

AOPCustom AnnotationData Permission
0 likes · 22 min read
Design and Implementation of a Flexible Data Permission System in Java
DaTaobao Tech
DaTaobao Tech
Dec 29, 2023 · Backend Development

Design Patterns and Practices for Fast, Stable Development in Taobao Innovation Projects

The article outlines how the Taobao “Calm Guard” project accelerates rapid‑iteration development by employing reusable patterns—including a Spring‑based Strategy registry, a hierarchical fatigue‑control framework, generic cache upsert via functional parameters, and precise AOP aspects—resulting in faster, more stable, and maintainable code.

AOPBackend DevelopmentJava
0 likes · 29 min read
Design Patterns and Practices for Fast, Stable Development in Taobao Innovation Projects