设计模式在燃料电池测试系统中的应用
2014-11-14何炳林
摘 要: 针对传统的面向过程的软件设计方法已无法应对市场对燃料电池测试系统快速的需求变化,提出将设计模式应用于燃料电池测试系统软件的开发过程,重点介绍了抽象工厂模式、命令模式、观察者模式、外观模式的应用。实验结果表明,基于面向对象设计模式开发的燃料电池测试系统软件具有良好的架构,实现了程序模块间的低耦合和模块内部的高内聚,提高了程序的可维护性和可复用性,能够灵活应对功能需求的变化。采用该架构开发完成的多款燃料电池测试软件运行稳定可靠。
关键词: 面向对象设计模式; 燃料电池; 测试系统; 软件开发
中图分类号: TN964?34 文献标识码: A 文章编号: 1004?373X(2014)22?0153?04
Application of design patterns in fuel cell test system
HE Bing?lin
(Guangdong Electronic Technology Research Institute, Guangzhou 510630, China)
Abstract: Because the traditional process?oriented software design methods have been unable to cope with rapidly changing needs of the market for fuel cell test system, the design patterns are proposed to apply to the fuel cell test system software development process. Four important patterns, including abstract factory pattern, command pattern, observer pattern and facade pattern, are described in detail. The experimental results show that the fuel cell test system software developed on the base of object?oriented design pattern has a good architecture, as well as implemented low coupling between modules and high cohesion within the module, and make the software more flexible to the functional requirements. The fuel cell test softwares developed with this architecture run stable and reliable.
Keywords: object?oriented design pattern; fuel cell; test system; software development
燃料电池是一种能够将储存在氢燃料和氧化剂中的化学能直接转化为电能的发电装置,它具有能量转换效率高、对环境污染小等优点[1]。燃料电池在世界范围掀起研究的热潮,目前国内外不少公司研制出专门的测试系统,以实现对燃料电池进行性能的评估。燃料电池测试系统(以下简称测试系统)包括测试设备以及配套的测试软件,其中测试软件平台提供用户与测试设备之间操作接口,是整个测试系统的核心。鉴于传统的面向过程的软件开发方法存在的问题,本文将研究如何将设计模式应用于燃料电池测试软件,设计出良好体系结构的系统,从而不仅使测试系统很好地应对快速多变的需求,同时使测试系统具有更好的稳定性、扩展性、维护性。……
