ACM Home Page
Please provide us with feedback. Feedback
Safely creating correct subclasses without seeing superclass code
Full text PdfPdf (252 KB)
Source Conference on Object Oriented Programming Systems Languages and Applications archive
Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications table of contents
Minneapolis, Minnesota, United States
Pages: 208 - 228  
Year of Publication: 2000
ISBN:1-58113-200-X
Also published in ...
Authors
Clyde Ruby  Department of Computer Science, Iowa State University, 226 Atanasoff Hall, Ames, IA
Gary T. Leavens  Department of Computer Science, Iowa State University, 226 Atanasoff Hall, Ames, IA
Sponsor
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 9,   Downloads (12 Months): 43,   Citation Count: 9
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/353171.353186
What is a DOI?

ABSTRACT

A major problem for object-oriented frameworks and class libraries is how to provide enough information about a superclass, so programmers can safely create new subclasses without giving away the superclass's code. Code inherited from the superclass can call down to methods of the subclass, which may cause nontermination or unexpected behavior. We describe a reasoning technique that allows programmers, who have no access to the code of the superclass, to determine both how to safely override the superclass's methods and when it is safe to call them. The technique consists of a set of rules and some new forms of specification. Part of the specification would be generated automatically by a tool, a prototype of which is planned for the formal specification language JML. We give an example to show the kinds of problems caused by method overrides and how our technique can be used to avoid them. We also argue why the technique is sound and give guidelines for library providers and programmers that greatly simplify reasoning about how to avoid problems caused by method overrides.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
 
2
 
3
 
4
 
5
 
6
P. H. B. Gardier and C. Morgan. A single complete rule for data refinement. In Morgan and Vickers {30}, pages 111-126.
 
7
P. H. B. Gardiner and C. Morgan. Data refinement of predicate transformers. In Morgan and Vickers {30}, pages 71-84.
 
8
 
9
 
10
C. A. R. Hoare. Proof of correctness of data representations. Acta Informatica, 1(4):271-281, 1972.
 
11
12
13
 
14
G. T. Leavens, A. L. Baker, and C. Ruby. JML: A notation for detailed design. In H. Kilov, B. Rumpe, and I. Simmonds, editors, Behavioral Specifications of Businesses and Systems, pages 175-188. Kluwer Academic Publishers, Boston, 1999.
 
15
G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. Technical Report 98-06i, Iowa State University, Department of Computer Science, Feb. 2000. See www.cs.iastate.edu/~leavens/JML.html.
 
16
G. T. Leavens and W. E. Weihl. Specification and verification of object-oriented programs using supertype abstraction. Acta Informatica, 32(8):705-778, Nov. 1995.
17
18
 
19
20
21
 
22
C. Lucas. Documenting Reuse and Evolution with Reuse Contracts. PhD thesis, Vrije Universiteit Brussel, Brussels, Belgium, Sept. 1997.
 
23
 
24
 
25
26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
 
34
A. D. Raghavan. Design of a JML documentation generator. Technical Report 00-12, Iowa State University, Department of Computer Science, July 2000.
 
35
36
 
37
38
 
39

CITED BY  9

Collaborative Colleagues:
Clyde Ruby: colleagues
Gary T. Leavens: colleagues