摘要
该文对面向对象和泛型程序设计 (genericprogramming)的核心思想和方法进行了较为深入的分析 ,阐明了各自的目标、技术特征及其优缺点所在 ,介绍了泛型程序设计针对对象技术的不足所引进的重大革新 ,即通过类型需求抽象来设计通用、高效的数据结构和算法 ;着重论述了作者在进一步增强泛型程序设计实际运用方面所提出的改进工作 ,以C ++语言的一个泛型编程扩充语言C 为实施例 ,详细说明了如何通过一种叫做“命名类型约束”的新的机制来比较完整地实现静态类型需求的直接语言支持和编译检查 ,为当前泛型程序设计模型的首例编程语言实例 .
A thorough and in-depth analysis of the underlying ideas and methodology of object-orientation and generic programming is presented, elaborating the aims, technological characteristics, advantages and disadvantages of both, with the emphasis on the significant innovation introduced by generic programming to compensate object-orientation for its insufficiency. The paper also details the author's work on further enhancing generic programming by providing direct language support and compiler checking for static type requirements, which leads to a new programming mechanism called named type constraint. As the first example of generic programming languages in the literatures, a generic programming extension of C++ is also discussed.
出处
《计算机学报》
EI
CSCD
北大核心
2004年第11期1492-1504,共13页
Chinese Journal of Computers
基金
国家自然科学基金项目 (60 2 0 3 0 2 2 ) (泛型程序设计方法
语言和泛型程序库研究 )资助 .