Tagged articles
State Pattern
14 articles · Page 1 of 1
The article demonstrates how the State design pattern replaces tangled if‑else state checks with dedicated state classes, using an order lifecycle example to compare it with Strategy, explain role responsibilities, transition driving mechanisms, and guidelines for when to apply the pattern.
JavaState PatternStrategy Pattern
0 likes · 15 min read

This article explains the State design pattern, illustrates its advantages over traditional conditional logic, provides a complete Java implementation with abstract state, concrete states, and context classes, demonstrates a real‑world order processing scenario using Spring StateMachine, and discusses related patterns, benefits, and drawbacks.
JavaOrder ProcessingSpring StateMachine
0 likes · 19 min read

This article explains the State (State Machine) pattern, its typical scenarios, core roles, and provides complete Java implementations—including a user login example and a Spring StateMachine‑driven order processing workflow—while comparing it with related patterns and outlining its pros and cons.
JavaSpring StateMachineState Pattern
0 likes · 15 min read

This article explains the State (State Machine) pattern, its typical scenarios such as order processing and elevator control, presents a complete Java implementation with abstract, concrete, and context classes, demonstrates how to model order workflows using Spring State Machine, compares related patterns, and discusses the pattern’s advantages and drawbacks.
JavaSpring State MachineState Pattern
0 likes · 14 min read

This article explains the State (State Machine) design pattern, its typical use cases, core roles, and practical Java implementations—including a login‑state example and a Spring StateMachine order workflow—while also comparing it with related patterns and outlining its advantages and drawbacks.
State Patternsoftware architecturestate machine
0 likes · 16 min read

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.
Behavioral PatternDesign PatternState Pattern
0 likes · 5 min read

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.
BackendDesign PatternJava
0 likes · 14 min read

This article explains the State design pattern, compares Spring State Machine with alternatives, and provides a complete Java example that models order status transitions using Spring Statemachine, including code, configuration, listeners, services, and test execution.
Order WorkflowSpring StateMachineState Pattern
0 likes · 15 min read

This article details the business flow, database schema, micro‑service architecture, caching strategies, state‑machine implementation, and concurrency handling for building a robust coupon system that enables merchants to bind coupons to rental listings and attract end‑users.
Coupon SystemState Patternbackend architecture
0 likes · 19 min read

The Taobao Scan feature was refactored by applying the Responsibility‑Chain, State, and Proxy design patterns, separating view and logic layers, introducing a fluent pipeline API, modular state handling, and a global proxy, which together dramatically improved code maintainability, extensibility, testability, and reduced development risk.
State Patterndesign patternsiOS
0 likes · 13 min read

Through a teacher‑student dialogue, the article demonstrates how the Strategy (with Adapter), State, Observer, Builder, and Decorator patterns can be applied to reward distribution, task management, and activity modeling, illustrating how these patterns decouple logic, enhance extensibility, and improve code maintainability.
Builder PatternDecorator PatternObserver Pattern
0 likes · 24 min read

This article explains why using if‑else for state handling violates the Open‑Closed Principle, introduces the State design pattern with a light‑switch example, demonstrates its implementation in JavaScript (including class‑based and functional FSM libraries), and compares it to the Strategy pattern.
Finite State MachineFrontend DevelopmentJavaScript
0 likes · 17 min read

The State pattern lets an object alter its behavior when its internal state changes, by encapsulating state-specific logic in separate classes and delegating behavior through a context, improving maintainability and flexibility in object-oriented systems.
JavaState Patternbehavioral
0 likes · 10 min read


21CTOOct 9, 2019 · Fundamentals
This article walks you through applying object‑oriented concepts in C by implementing the State design pattern, covering class simulation with structs, inheritance via macros, lifecycle management, polymorphism, and a complete client example that demonstrates state transitions for a water model.
C++PolymorphismState Pattern
0 likes · 13 min read
