摘要: 传统责任链设计模式采用面向对象的程序设计标准加以实现,过多强调程序的扩展性,但没有考虑并发性、空间及时间问题,在使用过程中造成空间及时间上的浪费,降低程序处理的并发性。针对上述问题,提出一种责任链设计模式创建过程,利用延迟初始化技术减少不必要的请求处理者数量。该方法不仅维持了责任链的核心应用思想及标准实现模式,而且能够根据实际请求码,创建具体处理实例,从而提高程序的整体性能。
关键词:
设计模式,
责任链,
延迟初始化,
并发性
Abstract: Object-Oriented Programming(OOP) standard is used to implement traditional Chain of Responsibility(CoR) design pattern, which puts too much emphasis on the expansion process, without taking into account the complicated nature of space and time problem. The process causes waste of time and space greatly and reduces the treatment of complicated procedures. Aiming at the problems, a CoR creating process is presented, which uses delay initialization technology to reduce unnecessary requests for the creation of the treatment process. This method is not only a responsibility to maintain the chai’s core applications and standards for the realization of the ideological model, but also can request in accordance with the actual code, to deal with the creation of specific examples, which greatly improves the performance of the procedure.
Key words:
design pattern,
Chain of Responsibility(CoR),
delay initialization,
concurrency
中图分类号:
齐 鑫. 责任链设计模式的改进[J]. 计算机工程, 2010, 36(10): 56-57.
QI Xin. Design Pattern Improvement of Chain of Responsibility[J]. Computer Engineering, 2010, 36(10): 56-57.