Advertisement

Sealing, Encapsulation, and Mutablility

  • Marina Biberstein
  • Joseph (Yossi) Gil
  • Sara Porat
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2072)

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

Java Virtual Machine Language Feature Call Site Java Package Morphism Level 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    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.Google Scholar
  2. [2]
    K. Arnold and J. Gosling. The Java Programming Language. The Java Series. Addison-Wesley, 1996.Google Scholar
  3. [3]
    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.Google Scholar
  4. [4]
    B. Blanchet. Escape analysis for Object Oriented languages. Application to Java. In OOPSLA 1999 [30], pages 20–34.Google Scholar
  5. [5]
    B. Bokowski and J. Vitek. Confined types. In OOPSLA 1999 [30], pages 82–96.Google Scholar
  6. [6]
    C. Bryce and C. Razafimahefa. An approach to safe object sharing. In OOPSLA 2000 [31], pages 367–381.Google Scholar
  7. [7]
    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.Google Scholar
  8. [8]
    L. Cardelli and P. Wegner. On understanding types, data abstractions, and polymorphism. ACM Comput. Surv., 17(4):471–522, Dec. 1985.CrossRefGoogle Scholar
  9. [9]
    J. D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape analysis for Java. In OOPSLA 1999 [30], pages 1–19.Google Scholar
  10. [10]
    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.CrossRefGoogle Scholar
  11. [11]
    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.Google Scholar
  12. [12]
    D. Denning. A lattice model of secure information flow. Commun. ACM, pages 236–243, 1976.Google Scholar
  13. [13]
    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.CrossRefGoogle Scholar
  14. [14]
    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.Google Scholar
  15. [15]
    N. Eckel and J. Y. Gil. Empirical study of object-layout strategies and optimization techniques. In Bertino [3], pages 394–421.Google Scholar
  16. [16]
    E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing. Addison-Wesley, 1995.Google Scholar
  17. [17]
    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.CrossRefGoogle Scholar
  18. [18]
    J. Gil and A. Itai. The complexity of type analysis of Object Oriented programs. In Jul [24], pages 601–634.Google Scholar
  19. [19]
    P. Grogono and M. Sakkinen. Copying and comparing: Problems and solutions. In Bertino [3], pages 226–250.Google Scholar
  20. [20]
    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.Google Scholar
  21. [21]
    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.Google Scholar
  22. [22]
    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.Google Scholar
  23. [23]
    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.Google Scholar
  24. [24]
    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.Google Scholar
  25. [25]
    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.Google Scholar
  26. [26]
    T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley Publishing Company, Reading, Massachusetts, second edition, 1999.Google Scholar
  27. [27]
    B. Meyer. Object-Oriented Software Construction. Prentice-Hall, 2nd edition, 1997.Google Scholar
  28. [28]
    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.Google Scholar
  29. [29]
    J. Noble, J. Vitek, and J. Potter. Flexible alias protection. In Jul [24], pages 158–185.Google Scholar
  30. [30]
    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.Google Scholar
  31. [31]
    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.Google Scholar
  32. [32]
    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.Google Scholar
  33. [33]
    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.Google Scholar
  34. [34]
    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.Google Scholar
  35. [35]
    B. Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997.Google Scholar
  36. [36]
    F. Tip and J. Palsberg. Scalable propagation-based call graph construction algorithms. In OOPSLA 2000 [31], pages 281–293.Google Scholar
  37. [37]
    TOOLS Pasific 2000. Proceedings of the International Conference on Technology of Object-Oriented Languages and Systems, Sydney, Australia, Nov. 2000. Prentice-Hall.Google Scholar
  38. [38]
    J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In OOPSLA 1999 [30], pages 187–206.Google Scholar
  39. [39]
    N. Wirth. The programming language Pascal. Acta Informatica, 1:35–63, 1971.MATHCrossRefGoogle Scholar
  40. [40]
    A. Zaks, V. Feldman, and N. Aizikowitz. Sealed calls in Java packages. In OOPSLA 2000 [31], pages 83–92.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Marina Biberstein
    • 1
  • Joseph (Yossi) Gil
    • 2
  • Sara Porat
    • 1
  1. 1.IBM Research Lab in Haifa, Advanced Technology CenterHaifaIsrael
  2. 2.Technion — Israel Institute of TechnologyHaifaIsrael

Personalised recommendations