Abstract
A well-defined boundary of components allows to encapsulate internal state and to distinguish between internal calls that remain inside the component and external calls that have target objects outside the component. From a static point of view, such boundaries define the programmer’s interface to the component. In particular, they define the methods that can be called on the component. From a dynamic point of view, the boundaries separate the component state and those parts of the program state outside the component.
In this tutorial paper, we investigate encapsulated components that are realized based on object-oriented concepts. We define a semantics that captures a flexible notion of hierarchical encapsulation with confined references. The semantics generalizes the encapsulation concepts of ownership types. It is used as a foundation for modular behavioral component specifications. In particular, it allows to provide a simple semantics for invariants and an alternative solution for the frame problem. We demonstrate this new specification methodology by typical programming patterns.
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
Ábrahám, E., Bonsangue, M.M., de Boer, F.S., Grüner, A., Steffen, M.: Observability, connectivity, and replay in a sequential calculus of classes. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2004. LNCS, vol. 3657, pp. 296–316. Springer, Heidelberg (2005)
Aldrich, J., Chambers, C.: Ownership domains: Separating aliasing policy from mechanism. In: Odersky [29], pp. 1–25
Banerjee, A., Naumann, D.A.: Representation independence, confinement and access control. In: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2002), pp. 166–177. ACM Press, New York (2002)
Barnett, M., Naumann, D.A.: Friends need a bit more: Maintaining invariants over shared state. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 54–84. Springer, Heidelberg (2004)
Barnett, M., DeLine, R., Fähndrich, M., Leino, K.R.M., Schulte, W.: Verification of object-oriented programs with invariants. Journal of Object Technology 3(6) (2004)
Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: Preventing data races and deadlocks. In: OOPSLA 2002 [30], pp. 211–230
Büchi, M.: Safe Language Mechanisms for Modularization and Concurrency. PhD thesis, Turku Centre for Computer Science (May 2000)
Clarke, D.: Object Ownership and Containment. PhD thesis, University of New South Wales (July 2001)
Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: Proceedings of the 13th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 1998), pp. 48–64. ACM Press, New York (1998)
DeLine, R., Fähndrich, M.: Typestates for objects. In: Odersky [29], pp. 465–490
Dietl, W., Müller, P.: Universes: Lightweight ownership for JML. Journal of Object Technology 4(8), 5–32 (2005)
Dietl, W., Müller, P., Poetzsch-Heffter, A.: A type system for checking applet isolation in Java Card. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 129–150. Springer, Heidelberg (2005)
Flatt, M., Krishnamurthi, S., Felleisen, M.: A programmer’s reduction semantics for classes and mixins. In: Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. LNCS, vol. 1523, pp. 241–269. Springer, Heidelberg (1999)
Gosling, J., Joy, B., Steele, G., Bracha, G.: The JavaTM Language Specification, 2nd edn. Addison-Wesley, Reading (2000)
Guttag, J.V., Horning, J.J.: Larch: Languages and Tools for Formal Specification. In: Texts and Monographs in Computer Science. Springer, Heidelberg (1993)
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS) 23(3), 396–450 (2001)
Leavens, G.T., Baker, A.L., Ruby, C.: JML: A notation for detailed design. In: Kilov, H., Rumpe, B., Simmonds, I. (eds.) Behavioral Specifications of Businesses and Systems, ch. 12, pp. 175–188. Kluwer, Dordrecht (1999)
Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML. Technical Report No. 98-06z, Iowa State University (2004)
Leino, K.R.M., Müller, P.: Object invariants in dynamic contexts. In: Odersky [29], pp. 491–516.
Leino, K.R.M., Nelson, G.: Data abstraction and information hiding. ACM Transactions on Programming Languages and Systems (TOPLAS) 24(5), 491–553 (2002)
Leino, K.R.M., Poetzsch-Heffter, A., Zhou, Y.: Using data groups to specify and check side effects. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation (PLDI 2002), pp. 246–257. ACM Press, New York (2002)
Microsoft. C# Language Specification (2001)
Müller, P.: Modular Specification and Verification of Object-Oriented Programs. LNCS, vol. 2262. Springer, Heidelberg (2002)
Müller, P., Poetzsch-Heffter, A.: Universes: A type system for alias and dependency control. Technical Report 279–1, Fernuniversität Hagen (2001)
Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular specification of frame properties in JML. Concurrency and Computation: Practice and Experience 15(2), 117–154 (2003)
Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular invariants for layered object structures. Technical Report 424, ETH Zürich, Chair of Software Engineering (2005)
Naumann, D.A.: Assertion-based encapsulation, object invariants and simulations. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2004. LNCS, vol. 3657, pp. 251–273. Springer, Heidelberg (2005)
Noble, J., Vitek, J., Potter, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)
Odersky, M. (ed.): ECOOP 2004. LNCS, vol. 3086. Springer, Heidelberg (2004)
Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 2002). ACM Press, New York (2002)
Poetzsch-Heffter, A.: Specification and verification of object-oriented programs. Habilitationsschrift, Technische Universität München (1997)
Pucella, R.: Towards a formalization for COM part I: the primitive calculus. In: OOPSLA 2002 [30], pp. 331–342 (2002)
Schäfer, J., Poetzsch-Heffter, A.: Simple fuzzy ownership domains (unpublished) (Preliminary version), Available at: http://softech.informatik.uni-kl.de/~janschaefer
Sun Microsystems, Inc., Palo Alto, CA. Java CardTM2.1.1 Virtual Machine Specification (May 2000)
Sun Microsystems, Inc. JavaTM2 Platform, Standard Edition, v 1.4.2 API Specification (2003), http://java.sun.com/j2se/1.4.2/docs/api/
Szyperski, C., Gruntz, D., Murer, S.: Component Software — Beyond Object-Oriented Programming, 2nd edn. Addison-Wesley, Reading (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Poetzsch-Heffter, A., Schäfer, J. (2006). Modular Specification of Encapsulated Object-Oriented Components. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, WP. (eds) Formal Methods for Components and Objects. FMCO 2005. Lecture Notes in Computer Science, vol 4111. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11804192_15
Download citation
DOI: https://doi.org/10.1007/11804192_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-36749-9
Online ISBN: 978-3-540-36750-5
eBook Packages: Computer ScienceComputer Science (R0)