Article Details

Title · Authors · Abstract · Keywords · DOI · References

Research and Application of the Combination of Strategy Model and Template Method Model

LIU He

(School of Computer and Control Engineering, Qiqihar University, Qiqihar 161006, China)

Section:Computer Technology · 2025, Vol. 9, No. 11 · Pages:92-95,101 · 2096-4706(2025)11-0092-05 · CLC number:TP311.5 · Document code:A · DOI:10.19850/j.cnki.2096-4706.2025.11.018

Abstract

In object-oriented programming, application design patterns play an important role in building a program structure that can improve reusability, enhance flexibility and maintainability. Taking the application of the combination of strategy model and template method model in the promotion activities of e-commerce system as an example, the UML class diagram of the combination of strategy model and template method model and its application in specific scenarios are introduced in detail. At the same time, it expounds the convenience of software expansion and reuse brought by design patterns, so as to enrich the application cases of design patterns. The experimental results show that the combination of the two design patterns can increase the reusability of the code, which is in line with the design principle of “open to extension, close to modification” and makes the system easier to expand.

Keywords

strategy model; template method model; UML class diagram

References

  1. [1] Liu Dong Analysis and Application of Data Driven Software Design Patterns [D]. Dalian: Dalian University of Technology, 2021
  2. [2] Xiao Chenglong, Wang Shanshan Application of Generative Artificial Intelligence in Software Design Pattern Course Teaching [J]. Computer Education, 2024 (11): 161-166
  3. [3] Jin Qiangshan, Feng Guang, Sun Chuanguo Comprehensive Experimental Design of "Observer Mode" Software Engineering [J]. Computer Age, 2022 (5): 105-108
  4. [4] Xiang Xiaoting Research and Application of Decorative Models in Software Design Patterns [J]. Modern Computer, 2024, 30 (7): 76-80
  5. [5] Fan Jianping, Song Zhongyan, Zhu Yin, etc Application of Design Patterns in Developing Simulator Terminal Software [J]. Fire and Command Control, 2023, 48 (7): 99-103
  6. [6] Cheng Xizhu Software Design Patterns (Java Version) [M]. Beijing: People's Posts and Telecommunications Press, 2018
  7. [7] Zhou Yuchen, Luo Xiangyang, Zhang Hao Design and Implementation of Warehouse System Based on Object Oriented Design Pattern [J]. Computer Age, 2018 (9): 33-36
  8. [8] GAMMA E, HELM R, JOHNSON R. Design Patterns: Fundamentals of Reusable Object Oriented Software [M]. Beijing: China Machinery Industry Press, 2021
  9. [9] Zhang Fushuai Analysis and Application of Laravel Framework Design Patterns [J]. Electronic Technology and Software Engineering, 2022 (23): 64-68
  10. [10] Jiang Haichang The Application of Open Closed Principle in Software Development [J]. Software Guide, 2012, 11 (4): 22-24

Funding

Higher Education Teaching Reform Project in Heilongjiang Province (SJYG20200780); Education Science Research Project of Qiqihar University (GJQTYB202208)

About the authors

Liu He (1996-), female, Han ethnicity, from Songyuan, Jilin, teaching assistant, master's degree, research direction: computer applications.