装饰设计模式思想及应用  

The Idea of the Decoration Design Pattern and Its Applications

在线阅读下载全文

作  者:杜学功 DU Xuegong(School of Information Engineering,Lanzhou University of Finance and Economics,Lanzhou 730020,China)

机构地区:[1]兰州财经大学信息工程学院,甘肃兰州730020

出  处:《兰州工业学院学报》2023年第1期90-94,共5页Journal of Lanzhou Institute of Technology

基  金:甘肃省哲学社会科学规划项目(2022YB077)。

摘  要:装饰设计模式是面向对象编程的主要设计模式,剖析了装饰设计模式的思想,采用案例设计、测试运行的方法对其在Java和JavaWeb中的重点应用进行分析,实现了处理字符集编码的请求包装器和进行文本替换的响应包装器。结果表明:包装类只有拥有被包装类对象并保持相同的接口,才能对其进行装饰设计,重用并增强其功能。The decoration design pattern is the main one of object-oriented programming.In this paper,the idea of the decoration design pattern is analyzed,the method of case design and test run is used to analyze its key applications in Java and JavaWeb.The request wrapper for handling character set encoding and a response wrapper for test substitution are realized.The results show that the wrapper class can be decorated,reused and enhanced only when it owns the object of the wrapper class and maintain the same interface.

关 键 词:装饰设计模式 接口 多态性 JavaEE-API SERVLET过滤器 

分 类 号:TP312[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象