Abstract
A criticism of the object-oriented style of programming is that the notion of class invariant seems to collapse in non-trivial client-supplier relationships: a supplier (“Dependent Delegate”) called from within the execution of a routine, where the invariant is not required to hold, may call back into the originating object, which it then catches in an inconsistent state. This is one of the problems arising from the application of assertion-based semantics to a model of computation involving references and the resulting possibility of dynamic aliasing.
This note suggests handling such cases by applying the basic non-objectoriented Hoare rule, instead of the version involving the invariant. It does not consider inheritance and dynamic binding.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Eiffel (1993–2004). EiffelStudio documentation. Eiffel Software. Online at eiffel.com.
Hoare, C. (1971). Procedures and parameters: An axiomatic approach. In Engeler, E., editor, Symposium on the Semantics of Programming Languages, volume 188 of Lecture Notes in Mathematics, pages 103–116. Springer-Verlag. reprinted in C. A. R. Hoare and C. B. Jones (eds.), Essays in Computing Science, Prentice Hall International 1989.
Hoare, C. (1972). Proofs of correctness of data representations. Acta Informatica, 1:271–281. reprinted in C. A. R. Hoare and C. B. Jones (eds.), Essays in Computing Science, Prentice Hall International, 1989, pages 103–115.
Leino, K. R. and Müller, P. (2004). Object invariants in dynamic contexts. In European Conference on Object-Oriented Programming, volume 3086 of LNCS, pages 491–516. Springer-Verlag.
Meyer, B. (1992). Eiffel: The Language. Prentice Hall. 2nd printing.
Meyer, B. (1997). Object-Oriented Software Construction. Prentice Hall, 2nd edition.
Müuller, P. (2002). Modular Specification and Verification of Object-Oriented Programs, volume 2262 of LNCS. Springer-Verlag.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer
About this paper
Cite this paper
Meyer, B. (2005). The Dependent Delegate Dilemma. In: Broy, M., Grünbauer, J., Harel, D., Hoare, T. (eds) Engineering Theories of Software Intensive Systems. NATO Science Series, vol 195. Springer, Dordrecht. https://doi.org/10.1007/1-4020-3532-2_4
Download citation
DOI: https://doi.org/10.1007/1-4020-3532-2_4
Publisher Name: Springer, Dordrecht
Print ISBN: 978-1-4020-3530-2
Online ISBN: 978-1-4020-3532-6
eBook Packages: Computer ScienceComputer Science (R0)