面向对象程序设计中契约式设计的扩展
Extending Design by Contract for Aspect-Oriented Programming
摘要:
契约式设计(DbC)和程序断言的运行时实施使得能够构建更健壮的软件。它还允许在错误报告中分配责任。不幸的是,没有对面向AOP的编程(AOP)的运行时契约执行和责任分配的支持。将DbC扩展到方面会带来大量与断言验证的正确顺序相关的问题。我们表明,没有一般正确的执行顺序的对象断言和方面断言。将方面进一步分类为不可知的、服从的或叛逆的,定义了需要遵循的断言验证顺序。我们描述了这种分类的应用程序中的原型DbC工具的AOP命名为科纳,方面用于实现合同,合同用于强制执行方面的断言。
英文摘要:
Design by Contract (DbC) and runtime enforcement of program assertions enables the construction of more robust software. It also enables the assignment of blame in error reporting. Unfortunately, there is no support for runtime contract enforcement and blame assignment for Aspect-Oriented Programming (AOP). Extending DbC to also cover aspects brings forward a plethora of issues related to the correct order of assertion validation. We show that there is no generally correct execution sequence of object assertions and aspect assertions. A further classification of aspects as agnostic, obedient, or rebellious defines the order of assertion validation that needs to be followed. We describe the application of this classification in a prototyped DbC tool for AOP named Cona, where aspects are used for implementing contracts, and contracts are used for enforcing assertions on aspects.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。