In this paper we show how to augment object-oriented application interfaces with enhanced specifications that include sequencing constraints called protocols. Protocols make explicit the relationship between messages (methods) supported by the application. These relationships are usually only given implicitly, either in the code or in textual comments. We define notions of interface compatibility based upon protocols and show how compatibility can be checked, discovering a class of errors that cannot be discovered via the type system alone. We then define software adaptors that can be used to bridge the difference between object-oriented applications that have functionally compatible but type incompatible interfaces. We discuss what it means for an adaptor to be well-formed. Leveraging the information provided by protocols, we show how adaptors can be automatically generated from a high-level description, called an interface mapping.
[1]
Joshua S. Auerbach,et al.
Concert/C: A Language for Distributed Programming
,
1994,
USENIX Winter.
[2]
Ming T. Liu,et al.
A synchronization model for protocol conversion
,
1989,
IEEE INFOCOM '89, Proceedings of the Eighth Annual Joint Conference of the IEEE Computer and Communications Societies.
[3]
Eric G. Manning,et al.
On the Progress of Communications between Two Finite State Machines
,
1984,
Inf. Control..
[4]
Jan van den Bos,et al.
A concurrent object-oriented language with protocols delegation and constraints
,
2005
.
[5]
Satish R. Thatte,et al.
Automated synthesis of interface adapters for reusable classes
,
1994,
POPL '94.
[6]
James M. Purtilo,et al.
Module reuse by interface adaptation
,
1991,
Softw. Pract. Exp..