摘 要:针对软件各种设计模式的定义不容易被透彻理解和灵活应用的问题,文章以装饰设计模式为例介绍其教学过程,深入解析装饰设计模式的动机,通过教学案例引入具体问题,从一般实现代码中发现存在的问题,经过分析和重构得出装饰设计模式的结构和要点,使学生对装饰设计模式有更深入的理解,达到让学生日后可以灵活使用该模式的目的。
关键词:设计模式;装饰设计模式;重构;教学过程
中图分类号:TP312;G642.0 文献标识码:A 文章编号:2096-4706(2020)09-0101-03
Teaching Process Research of Decorator Design Pattern
ZHU Hongmei,WANG Lu
(College of Information Science and Engineering,Shandong Agricultural University,Tai’an 271018,China)
Abstract:Aiming at the problem that the definitions of various software design patterns is not easy to be fully understood and flexibly applied,this paper takes Decorator Design Pattern as an example for teaching process design. The motivation of decoration design pattern is deeply analyzed. A specific problem as teaching case is introduced. From the general implementation of the example existing problems is found. The structure and key points of the decorator design pattern is gotten through analysis and reconstruction,through which the students have a deeper understanding of the decorator design pattern and achieve the purpose of flexible use of it.
Keywords:design pattern;decorator design pattern;reconstruction;teaching process
基金项目:教育部2018 年第二批产学合作协同育人项目(201802047140)
参考文献:
[1] 温立辉. 软件设计模式分析 [J]. 科技创新与应用,2020(7):92-93.
[2] GAMMA E,HELM R,JOHNSON R,et al.DesignPatterns:Elements of Reusable Object-Oriented Software [M]. NewJersey USA:Addison-Wesley Publishing Company,1995.
[3] 肖力,周斌. 推进信息化教学 打造精彩教学设计 [J]. 物理教师,2020,41(2):25-29+32.
[4] 杨承清,吕耀平,戴庆敏,等. 基于直观认知的《园林设计初步》过程性教学改革探析 [J]. 西南师范大学学报(自然科学版),2019,44(11):161-166.
[5] 纪程宇,朱雪峰. 设计模式组合操作优化研究 [J]. 计算机科学,2020,47(3):19-24.
作者简介:
朱红梅(1969.12—),女,汉族,上海崇明人,副教授,博士,研究方向:知识工程、智能信息处理;
王鲁(1981.11—),男,汉族,山东泰安人,副教授,博士,研究方向:智能信息处理。