| Safely creating correct subclasses without seeing superclass code |
| Full text |
Pdf
(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 |
|
| Publisher |
|
| Bibliometrics |
Downloads (6 Weeks): 9, Downloads (12 Months): 43, Citation Count: 9
|
|
|
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
|
Ralph-Johan J. Back , Abo Akademi , J. Von Wright , F. B. Schneider , D. Gries, Refinement Calculus: A Systematic Introduction, Springer-Verlag New York, Inc., Secaucus, NJ, 1998
|
| |
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
|
Gregor Kiczales , John Lamping, Issues in the design and specification of class libraries, conference proceedings on Object-oriented programming systems, languages, and applications, p.435-451, October 18-22, 1992, Vancouver, British Columbia, Canada
|
 |
13
|
John Lamping, Typing the specialization interface, Proceedings of the eighth annual conference on Object-oriented programming systems, languages, and applications, p.201-214, September 26-October 01, 1993, Washington, D.C., United States
|
| |
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
|
K. Rustan M. Leino, Data groups: specifying the modification of extended state, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.144-153, October 18-22, 1998, Vancouver, British Columbia, Canada
|
| |
19
|
|
 |
20
|
|
 |
21
|
Barbara Liskov , Jeannette M. Wing, Specifications and their use in defining subtypes, Proceedings of the eighth annual conference on Object-oriented programming systems, languages, and applications, p.16-28, September 26-October 01, 1993, Washington, D.C., United States
|
| |
22
|
C. Lucas. Documenting Reuse and Evolution with Reuse Contracts. PhD thesis, Vrije Universiteit Brussel, Brussels, Belgium, Sept. 1997.
|
| |
23
|
|
| |
24
|
|
| |
25
|
|
 |
26
|
Mira Mezini, Maintaining the consistency of class libraries during their evolution, Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.1-21, October 05-09, 1997, Atlanta, Georgia, United States
|
| |
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
|
Patrick Steyaert , Carine Lucas , Kim Mens , Theo D'Hondt, Reuse contracts: managing the evolution of reusable assets, Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.268-285, October 06-10, 1996, San Jose, California, United States
|
| |
39
|
|
CITED BY 9
|
|
|
|
|
|
|
|
Clyde D. Ruby, Safely creating correct subclasses without seeing superclass code, Addendum to the 2000 proceedings of the conference on Object-oriented programming, systems, languages, and applications (Addendum), p.155-156, January 2000, Minneapolis, Minnesota, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INDEX TERMS
Primary Classification:
D.
Software
D.3
PROGRAMMING LANGUAGES
D.3.2
Language Classifications
Nouns:
Java
Additional Classification:
D.
Software
D.2
SOFTWARE ENGINEERING
D.2.1
Requirements/Specifications
Subjects:
Languages
D.3
PROGRAMMING LANGUAGES
D.3.2
Language Classifications
Subjects:
Object-oriented languages
General Terms:
Design,
Languages,
Performance,
Theory
Keywords:
JML language,
Java language,
downcalls,
method refinement,
semantic fragile subclassing problem,
specification inheritance,
subclass,
subclassing contract
|