基于设计模式的类层次结构扩展以支持类不变性检查
Design Pattern-Based Extension of Class Hierarchies to Support Runtime Invariant Checks
摘要:
我们提出了一种技术,自动编织结构不变检查到现有的类集合。使用现有的设计模式的变化,我们使用一个简洁的规范,从这个集合中生成一组新的类,实现原始的接口,但增加了用户指定的类不变检查。我们的工作值得注意的是所做的假设很少。与以前的设计模式方法不同,我们的技术不需要修改原始源代码,只依赖于单一继承,并且不要求检查中使用的属性是公开可见的。我们能够检测各种各样的类层次结构,包括纯接口,抽象类和带类型参数的类。我们已经将构造实现为用于Java开发的Eclipse插件。
英文摘要:
We present a technique for automatically weaving structural invariant checks into an existing collection of classes. Using variations on existing design patterns, we use a concise specification to generate from this collection a new set of classes that implement the interfaces of the originals, but with the addition of user-specified class invariant checks. Our work is notable in the scarcity of assumptions made. Unlike previous design pattern approaches to this problem, our technique requires no modification of the original source code, relies only on single inheritance, and does not require that the attributes used in the checks be publicly visible. We are able to instrument a wide variety of class hierarchies, including those with pure interfaces, abstract classes and classes with type parameters. We have implemented the construction as an Eclipse plug-in for Java development.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。