摘要
客户-供方契约规定了软件系统每一步操作的责任和义务。契约式设计中引入异常处理机制以应对发生在运行环境下的契约违背。该种异常处理机制协助契约式设计规范以开发正确与健壮的软件。契约式异常处理并不构成客户-供方契约的一部分,但是作为一个契约组件必须按契约编写。总结契约式设计中异常的分类和转移原则、界限原则、应急原则、恢复原则等异常处理原则,列举在Eiffel、JML等框架下异常处理的应用。
Client-supplier contract specifies responsibilities and obligations of every operation in a software system. Exception handling mechanism is introduced to deal with contract violations in an operational setting, which assists the specification of design by contract for developing correct and robust software. The exception handling is not part of the client-sup- plier contract, but as a contract component, it must be written according to contract. Sum- marizes exception classification and exception handling principle such as transfer principle, boundary principle, panic principle and resumption principle, illustrates exception handling applications under frameworks like Eiffel and JML.
出处
《现代计算机》
2009年第10期41-44,共4页
Modern Computer
关键词
契约式设计
异常处理机制
客户-供方契约
Design by Contract
Exception Handling Mechanism
Client-Supplier Contract