计算机应用

• 典型应用 • 上一篇    下一篇

多类型混合运算的面向对象设计与实现

师鸣若 姜中华   

  1. 北京物资学院 中国科学院软件研究所
  • 收稿日期:2008-07-28 修回日期:2008-09-16 发布日期:2009-01-01 出版日期:2009-01-01
  • 通讯作者: 师鸣若

Object-oriented design and implementation for multi-type mixed operation

<a href="http://www.joca.cn/EN/article/advancedSearchResult.do?searchSQL=(((Zhonghua Jiang[Author]) AND 1[Journal]) AND year[Order])" target="_blank">Zhonghua Jiang</a>   

  • Received:2008-07-28 Revised:2008-09-16 Online:2009-01-01 Published:2009-01-01

摘要: 针对多种数据类型的混合运算问题进行了研究。讨论了面向过程的解决方案和两种可能的面向对象解决方案及不足。依据敏捷设计原则,提出了一种双层函数指针数组(虚表)的面向对象新方案。分析表明,该设计具备开放封闭性,解决了灵活性、可重用性、可维护性和效率问题。

关键词: 敏捷设计原则, 开放封闭原则(OCP), 函数指针数组

Abstract: Through studying multi-type arithmetic in many systems, it is found that the existing solutions are not flexible. Process-oriented solution and two potential object-oriented solutions were given and their shortages were analyzed. To achieve flexibility, reusability, maintainability and efficiency, a two-layer virtual table object-oriented solution was proposed based on agile design policy and the Open-Closed Principle (OCP). Analysis shows that the solution is relatively good.

Key words: agile design policy, open-closed principle (OCP), virtual table