Astract
Both encapsulation and immutability are important mechanisms, that support good software engineering practice. Encapsulation protects a variable against all kinds of access attempts from certain sections of the program. Immutability protects a variable only against write access attempts, irrespective of the program region from which these attempts are made. Taking mostly an empirical approach, we study these concepts and their interaction in JAVA.We propose code analysis techniques, which, using the new sealing information, can help to identify variables as encapsulated, immutable, or both.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Work done in part while with IBM Research Lab in Haifa.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
P. S. Almeida. Balloon types: Controlling sharing of state in data types. In M. Akşit and S. Matsuoka, editors, Proceedings of the 11 th European Conference on Object-Oriented Programming, number 1241 in Lecture Notes in Computer Science, pages 32–59, Jyväskylä, Finland, June 9-13 1997. ECOOP’97, Springer Verlag.
K. Arnold and J. Gosling. The Java Programming Language. The Java Series. Addison-Wesley, 1996.
E. Bertino, editor. Proceedings of the 14 th European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, Sophia Antipolis and Cannes, France, June 12-16 2000. ECOOP 2000, Springer Verlag.
B. Blanchet. Escape analysis for Object Oriented languages. Application to Java. In OOPSLA 1999 [30], pages 20–34.
B. Bokowski and J. Vitek. Confined types. In OOPSLA 1999 [30], pages 82–96.
C. Bryce and C. Razafimahefa. An approach to safe object sharing. In OOPSLA 2000 [31], pages 367–381.
B. Calder, C. Krintz, and U. Hölzle. Reducing transfer delay using Java class file splitting and prefetching. In OOPSLA 1999 [30], pages 276–291.
L. Cardelli and P. Wegner. On understanding types, data abstractions, and polymorphism. ACM Comput. Surv., 17(4):471–522, Dec. 1985.
J. D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape analysis for Java. In OOPSLA 1999 [30], pages 1–19.
D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. In Proceedings of the 13 th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 48–64, Vancouver, British Columbia, Oct.18-22 1998. OOPSLA’98, ACM SIGPLAN Notices 33(10) Oct. 1998.
T. Cohen and J. Y. Gil. Self-calibration of metrics of Java methods. In Proceedings of the International Conference on Technology of Object-Oriented Languages and Systems [37], pages 94–106.
D. Denning. A lattice model of secure information flow. Commun. ACM, pages 236–243, 1976.
D. Dillenberger, R. Bordawekar, C.W. Clark, D. Durand, D. Emmes, O. Gohda, S. Howard, M. F. Oliver, F. Samuel, and R. W. S. John. Building a Java Virtual Machine for server applications: The JVM on OS/390. IBM Systems Journal, 39(1):194–210, 2000. Reprint Order No. G321-5723. 8.
K. Driesen and U. Hölzle. The direct cost of virtual functions calls in C++. In Proceedings of the 11 th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 306–323, San Jose, California, Oct. 6-10 1996. OOPSLA’96, ACM SIGPLAN Notices 31(10) Oct. 1996.
N. Eckel and J. Y. Gil. Empirical study of object-layout strategies and optimization techniques. In Bertino [3], pages 394–421.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing. Addison-Wesley, 1995.
S. Ghemawat, K. H. Randall, and D. J. Scales. Field analysis: Getting useful and lowcost interprocedural information. In Proceedings of the ACM SIGPLAN’00 Conference on Programming Language Design and Implementation (PLDI), pages 334–344, Vancouver, BC Canada, June 18-21 2000. ACM SIGPLAN, ACM Press.
J. Gil and A. Itai. The complexity of type analysis of Object Oriented programs. In Jul [24], pages 601–634.
P. Grogono and M. Sakkinen. Copying and comparing: Problems and solutions. In Bertino [3], pages 226–250.
D. Hagimont, J. Mossiere, X. de Pina, and F. Saunier. Hidden software capabilities. In Proceedings of the 16 th IEEE International Conference on Distributed Computing Systems, pages 282–289, Hong Kong, May 27-30 1996.
H. Hakonen, V. Leppanen, T. Raita, T. Salakoski, and J. Teuhola. Improving object integrity and preventing side effects via deeply immutable references. In Proceedings of 6 th Fenno-Ugric Symposium on Software Technology, (FUSST’99), pages 139–150, Sagadi, Estonia, Aug. 19-21 1999.
T. Hill, J. Noble, and J. Potter. Scalable visualisations with ownership types. In Proceedings of the International Conference on Technology of Object-Oriented Languages and Systems [37], pages 202–213.
J. Hogg. Islands: Aliasing protection in object-oriented languages. In Proceedings of the 6 th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 271–285, Phoenix, Arizona, USA, Oct.6-11 1991. OOPSLA’91, ACM SIGPLAN Notices 26(11) Nov. 1991.
E. Jul, editor. Proceedings of the 12 th European Conference on Object-Oriented Programming, number 1445 in Lecture Notes in Computer Science, Brussels, Belgium, July 20-24 1998. ECOOP’98, Springer Verlag.
G. Kniesel and D. Theisen. JAC-Java with transitive readonly access control. In Proceedings of the Intercontinental Workshop on Aliasing in Object-Oriented Systems 9, Lisbon, Portugal, June 14-18 1999.
T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley Publishing Company, Reading, Massachusetts, second edition, 1999.
B. Meyer. Object-Oriented Software Construction. Prentice-Hall, 2nd edition, 1997.
N. H. Minsky. Towards alias-free pointers. In P. Cointe, editor, Proceedings of the 10 th European Conference on Object-Oriented Programming, number 1098 in Lecture Notes in Computer Science, pages 189–209, Linz, Austria, July 8-12 1996. ECOOP’96, Springer Verlag.
J. Noble, J. Vitek, and J. Potter. Flexible alias protection. In Jul [24], pages 158–185.
OOPSLA 1999. Proceedings of the 14 th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, Denver, Colorado, Nov. 1-5 1999. ACM SIGPLAN Notices 34(10) Nov. 1999.
OOPSLA 2000. Proceedings of the 15 th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, Minneapolis, Minnesota, Oct. 15-19 2000. ACM SIGPLAN Notices 35(10) Oct. 2000.
S. Porat, M. Biberstein, L. Koved, and B. Mendelson. Mutability analysis in Java. In Proceedings of Centre for Advance Studies Conference (CASCON) 10, pages 169–183, Mississauga, Ontario, Canada, Nov. 13-26 2000.
C. Skalka and S. Smith. Static enforcement of security with types. In P. Wadler, editor, Proceedings of the International Conference on Functional Programming (ICFP), Montreal, Canada, Sept. 18–20 2000.
A. Snyder. Encapsulation and inheritance in object-oriented programming languages. In N. K. Meyrowitz, editor, Proceedings of the 1st Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 38–45, Portland, Oregon, USA, Sept. 29-Oct. 2 1986. OOPSLA’86, ACM SIGPLAN Notices 21(11) Nov. 1986.
B. Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997.
F. Tip and J. Palsberg. Scalable propagation-based call graph construction algorithms. In OOPSLA 2000 [31], pages 281–293.
TOOLS Pasific 2000. Proceedings of the International Conference on Technology of Object-Oriented Languages and Systems, Sydney, Australia, Nov. 2000. Prentice-Hall.
J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In OOPSLA 1999 [30], pages 187–206.
N. Wirth. The programming language Pascal. Acta Informatica, 1:35–63, 1971.
A. Zaks, V. Feldman, and N. Aizikowitz. Sealed calls in Java packages. In OOPSLA 2000 [31], pages 83–92.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Biberstein, M., Gil, J.(., Porat, S. (2001). Sealing, Encapsulation, and Mutablility. In: Knudsen, J.L. (eds) ECOOP 2001 — Object-Oriented Programming. ECOOP 2001. Lecture Notes in Computer Science, vol 2072. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45337-7_3
Download citation
DOI: https://doi.org/10.1007/3-540-45337-7_3
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42206-8
Online ISBN: 978-3-540-45337-6
eBook Packages: Springer Book Archive