摘要
运用行为子类型及扩充行为子类型的概念,通过对一个Java实例地剖析,讨论了在面向 对象的契约式程序设计中如何撰写契约,以保持面向对象的单个继承和多重继承的特性问题,并证明 了这一方法的有效性。最后探讨了动态环境下违反契约时的责任归咎,展望了契约思想在软件开发 中的运用前景。
A notion of behavior subtyping and its extension was introduced.By analysing an example of Java,how to design in object-oriented programming by contract was discussed in order to keep the features of single and multiple inheritance.The effectivity of the method was demonstrated.Finally,how to assign blame when contracts were violated in dynamic enviroment was discussed. The perspective of contract used in software development was outlooked.
出处
《计算机应用》
CSCD
北大核心
2005年第4期796-798,共3页
journal of Computer Applications
基金
国家自然科学基金资助项目(60373086)
关键词
行为子类型
契约
前置条件
后置条件
不变式
behavior subtyping
contract
precondition
postcondition
invariant