摘要
针对软件各种设计模式的定义不容易被透彻理解和灵活应用的问题,文章以装饰设计模式为例介绍其教学过程,深入解析装饰设计模式的动机,通过教学案例引入具体问题,从一般实现代码中发现存在的问题,经过分析和重构得出装饰设计模式的结构和要点,使学生对装饰设计模式有更深入的理解,达到让学生日后可以灵活使用该模式的目的.
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.
作者
朱红梅
王鲁
ZHU Hongmei;WANG Lu(College of Information Science and Engineering,Shandong Agricultural University,Tai’an 271018,China)
出处
《现代信息科技》
2020年第9期101-103,共3页
Modern Information Technology
基金
教育部2018年第二批产学合作协同育人项目(201802047140)。
关键词
设计模式
装饰设计模式
重构
教学过程
design pattern
decorator design pattern
reconstruction
teaching process