Tag

template method

1 views collected around this technical thread.

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.

Design PatternsFactory MethodJava
0 likes · 6 min read
Simplify Multi‑Channel Order Processing with Template, Factory & Strategy Patterns
macrozheng
macrozheng
Sep 11, 2023 · Backend Development

Mastering Code Refactoring: From Repetition to Design Patterns in Java

This article walks through a step‑by‑step refactoring of repetitive Java code, illustrating how to extract common methods, use reflection, apply generics with lambda expressions, leverage inheritance and the template method pattern, and finally combine factory, template, and strategy patterns into a clean, reusable solution.

Design PatternsFactory PatternJava
0 likes · 13 min read
Mastering Code Refactoring: From Repetition to Design Patterns in Java
Zhuanzhuan Tech
Zhuanzhuan Tech
Aug 16, 2023 · Backend Development

Refactoring the Game Account Order Process with a Three‑Layer Interface and Strategy‑Template Pattern

This article describes how a game‑account order system with scattered core code and no design patterns was refactored into a clean three‑layer interface architecture using a strategy‑template approach, detailing the design, implementation, testing, gray‑release strategy, and post‑deployment safeguards.

Design PatternsJavabackend architecture
0 likes · 12 min read
Refactoring the Game Account Order Process with a Three‑Layer Interface and Strategy‑Template Pattern
Code Ape Tech Column
Code Ape Tech Column
Apr 6, 2023 · Backend Development

Applying the Open‑Closed Principle and Bitmask Design for Extensible System Architecture

The article explains the six SOLID design principles, emphasizes the importance of the Open‑Closed principle, and demonstrates how to achieve extensible database schemas and APIs using type fields, extendable JSON columns, bitmap role encoding, and strategy/template patterns with concrete Java code examples.

Database DesignDesign PatternsOpen-Closed Principle
0 likes · 15 min read
Applying the Open‑Closed Principle and Bitmask Design for Extensible System Architecture
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 PatternJavaSoftware Engineering
0 likes · 10 min read
Template Method Design Pattern: Concepts, Implementation, and Usage
macrozheng
macrozheng
Jan 20, 2023 · Fundamentals

Master Template, Strategy, and Factory Patterns with Real‑World Java Examples

This article walks you through three classic design patterns—Template Method, Strategy, and Factory—using clear Java code samples, visual diagrams, and practical refactoring tips, so you can understand when and how to apply each pattern in real projects.

Design PatternsFactory PatternJava
0 likes · 18 min read
Master Template, Strategy, and Factory Patterns with Real‑World Java Examples
Code Ape Tech Column
Code Ape Tech Column
Aug 19, 2022 · Backend Development

Refactoring Classic Design Patterns with Java 8 Features: Strategy, Template Method, Observer, and Chain of Responsibility

This article demonstrates how Java 8's lambda expressions and functional interfaces can simplify traditional implementations of the Strategy, Template Method, Observer, and Chain‑of‑Responsibility design patterns by reducing boilerplate code and consolidating multiple classes into concise functional constructs.

Chain of ResponsibilityDesign PatternsJava
0 likes · 11 min read
Refactoring Classic Design Patterns with Java 8 Features: Strategy, Template Method, Observer, and Chain of Responsibility
Code Ape Tech Column
Code Ape Tech Column
Jul 15, 2022 · Backend Development

Eliminating Code Duplication in Java Business Logic with Design Patterns, Annotations, and Bean Mapping

This article explains how to reduce repetitive Java business code by applying the factory and template‑method patterns for shopping‑cart processing, using custom annotations with reflection to generate API requests, and leveraging bean‑mapping utilities to copy properties between DTO/DO objects, while illustrating each technique with concrete code examples.

AnnotationsDesign PatternsFactory Pattern
0 likes · 21 min read
Eliminating Code Duplication in Java Business Logic with Design Patterns, Annotations, and Bean Mapping
macrozheng
macrozheng
Jun 14, 2022 · Backend Development

Refactor Java Business Logic with Strategy, Factory, and Template Method Patterns

This article demonstrates step‑by‑step how to improve existing Java code by applying the Strategy, Factory, and Template Method design patterns, reducing duplicated if‑else branches, adhering to the Open‑Closed and Single‑Responsibility principles, and making the logic more extensible and maintainable.

Design PatternsFactory PatternJava
0 likes · 11 min read
Refactor Java Business Logic with Strategy, Factory, and Template Method Patterns
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
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
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
vivo Internet Technology
vivo Internet Technology
Oct 8, 2021 · Fundamentals

Applying Design Patterns to Improve Extensibility in Vivo Marketing Automation Engine

The Vivo Internet Server Team demonstrates how applying classic design patterns—factory, template method, strategy, and state—alongside finite‑state machines or workflow engines can dramatically improve the scalability, maintainability, and extensibility of a visual marketing automation engine for rapidly changing business scenarios.

Design PatternsFactory PatternState Machine
0 likes · 19 min read
Applying Design Patterns to Improve Extensibility in Vivo Marketing Automation Engine
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 PatternJavaMyBatis
0 likes · 12 min read
Template Method Design Pattern in Java: Theory, Implementation, and Framework Applications
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 10, 2021 · Fundamentals

Understanding the Template Method Design Pattern with Java Examples

This article explains the Template Method design pattern, illustrating its structure with Java drink‑making examples, discussing hook methods, and showing real‑world usages in JDK’s Comparable and Spring’s ApplicationContext, while highlighting advantages, drawbacks, and practical scenarios.

Design PatternHook MethodInheritance
0 likes · 16 min read
Understanding the Template Method Design Pattern with Java Examples
Java Captain
Java Captain
Feb 20, 2021 · Backend Development

Spring Framework Design Patterns: Summary and Implementation Details

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

AdapterBeanFactoryDesign Patterns
0 likes · 15 min read
Spring Framework Design Patterns: Summary and Implementation Details
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jan 23, 2021 · Fundamentals

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

This article explains the Template Method design pattern, illustrating its algorithm skeleton with tea‑making analogies, detailed Java code for abstract and concrete classes, and real‑world applications in Spring, MyBatis, and other backend frameworks, while discussing its advantages and drawbacks.

Design PatternMyBatisSpring
0 likes · 11 min read
Template Method Design Pattern in Java: Theory, Code Examples, and Framework Applications
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 9, 2020 · Fundamentals

Understanding the Template Method Design Pattern with Java Examples

This article explains the Template Method design pattern, illustrating its structure with Java code examples—including an abstract Drinks class, concrete Tea and Coffee subclasses, hook methods, and real‑world usages in JDK sorting and Spring's application context—while highlighting advantages, drawbacks, and typical scenarios.

Design PatternHook MethodJava
0 likes · 12 min read
Understanding the Template Method Design Pattern with Java Examples
Baidu Waimai Technology Team
Baidu Waimai Technology Team
Aug 22, 2017 · Backend Development

Design and Iterative Refactoring of a Permission Application Workflow on the Do Platform

This article describes the business flow, storage schema, template‑method based code framework, workflow integration, Redis‑based lock mechanism, and two major refactoring iterations that improve the permission‑application approval process for the Do platform.

Redisbackendmysql
0 likes · 11 min read
Design and Iterative Refactoring of a Permission Application Workflow on the Do Platform