扩展了一种设计软件契约的方法

R. Mitchell, J. McKim
{"title":"扩展了一种设计软件契约的方法","authors":"R. Mitchell, J. McKim","doi":"10.1109/TOOLS.1999.809429","DOIUrl":null,"url":null,"abstract":"Classes in object-oriented programs can be specified using assertions, specifically, preconditions and postconditions on individual methods and invariants on whole classes. Such assertions can be seen as forming a contract between a class and its client classes and, by extension, between the developers of class and the developers of client classes. In some programming environments, the contracts can be checked at runtime. A published method of devising contracts is applied to a small framework based on the observer pattern, raising a number of problems of writing contracts for a set of collaborating classes, rather than for individual classes such as those formed in data structure libraries. As well as providing an example of tackling such problems, the paper identifies desirable extensions to the method of devising contracts, to address aspects of performance (keeping the run-time cost of evaluating preconditions low); privacy (ensuring that one client of a class cannot discover the identities of other clients); extensibility (allowing subclasses to weaken preconditions without invalidating existing postconditions, and allowing subclasses to adopt different frame rules); and kinds of constraints (distinguishing physical and logical constraints).","PeriodicalId":272695,"journal":{"name":"Proceedings Technology of Object-Oriented Languages and Systems. TOOLS 32","volume":"26 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1999-11-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Extending a method of devising software contracts\",\"authors\":\"R. Mitchell, J. McKim\",\"doi\":\"10.1109/TOOLS.1999.809429\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Classes in object-oriented programs can be specified using assertions, specifically, preconditions and postconditions on individual methods and invariants on whole classes. Such assertions can be seen as forming a contract between a class and its client classes and, by extension, between the developers of class and the developers of client classes. In some programming environments, the contracts can be checked at runtime. A published method of devising contracts is applied to a small framework based on the observer pattern, raising a number of problems of writing contracts for a set of collaborating classes, rather than for individual classes such as those formed in data structure libraries. As well as providing an example of tackling such problems, the paper identifies desirable extensions to the method of devising contracts, to address aspects of performance (keeping the run-time cost of evaluating preconditions low); privacy (ensuring that one client of a class cannot discover the identities of other clients); extensibility (allowing subclasses to weaken preconditions without invalidating existing postconditions, and allowing subclasses to adopt different frame rules); and kinds of constraints (distinguishing physical and logical constraints).\",\"PeriodicalId\":272695,\"journal\":{\"name\":\"Proceedings Technology of Object-Oriented Languages and Systems. TOOLS 32\",\"volume\":\"26 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1999-11-22\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings Technology of Object-Oriented Languages and Systems. TOOLS 32\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/TOOLS.1999.809429\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings Technology of Object-Oriented Languages and Systems. TOOLS 32","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/TOOLS.1999.809429","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

摘要

面向对象程序中的类可以使用断言来指定,具体地说,就是在单个方法上使用前置条件和后置条件,在整个类上使用不变量。这样的断言可以被看作是在类和它的客户类之间形成了一种契约,通过扩展,在类的开发人员和客户类的开发人员之间形成了一种契约。在某些编程环境中,可以在运行时检查契约。一种已发布的设计契约的方法应用于基于观察者模式的小型框架,这引发了为一组协作类编写契约的许多问题,而不是为数据结构库中形成的单个类编写契约。除了提供解决此类问题的示例外,本文还确定了设计契约方法的理想扩展,以解决性能方面的问题(保持评估先决条件的运行时成本较低);隐私(确保类的一个客户端不能发现其他客户端的身份);可扩展性(允许子类在不使现有后置条件失效的情况下削弱前提条件,并允许子类采用不同的帧规则);约束的种类(区分物理约束和逻辑约束)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Extending a method of devising software contracts
Classes in object-oriented programs can be specified using assertions, specifically, preconditions and postconditions on individual methods and invariants on whole classes. Such assertions can be seen as forming a contract between a class and its client classes and, by extension, between the developers of class and the developers of client classes. In some programming environments, the contracts can be checked at runtime. A published method of devising contracts is applied to a small framework based on the observer pattern, raising a number of problems of writing contracts for a set of collaborating classes, rather than for individual classes such as those formed in data structure libraries. As well as providing an example of tackling such problems, the paper identifies desirable extensions to the method of devising contracts, to address aspects of performance (keeping the run-time cost of evaluating preconditions low); privacy (ensuring that one client of a class cannot discover the identities of other clients); extensibility (allowing subclasses to weaken preconditions without invalidating existing postconditions, and allowing subclasses to adopt different frame rules); and kinds of constraints (distinguishing physical and logical constraints).
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信