Skip to main content

Composable Encapsulation Policies

  • Conference paper
ECOOP 2004 – Object-Oriented Programming (ECOOP 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3086))

Included in the following conference series:

Abstract

Given the importance of encapsulation to object-oriented programming, it is surprising to note that mainstream object-oriented languages offer only limited and fixed ways of encapsulating methods. Typically one may only address two categories of clients, users and heirs, and one must bind visibility and access rights at an early stage. This can lead to inflexible and fragile code as well as clumsy workarounds. We propose a simple and general solution to this problem in which encapsulation policies can be specified separately from implementations. As such they become composable entities that can be reused by different classes. We present a detailed analysis of the problem with encapsulation and visibility mechanisms in mainstream OO languages, we introduce our approach in terms of a simple model, and we evaluate how our approach compares with existing approaches. We also assess the impact of incorporating encapsulation policies into Smalltalk.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. American National Standards Institute, Inc. In: The Programming Language Ada. LNCS, vol. 155, Springer, Heidelberg (1983)

    Google Scholar 

  2. Bracha, G.: The Programming Language igsaw: Mixins, Modularity and Multiple Inheritance. Ph.D. thesis, Dept. of Computer Science, University of Utah (March 1992)

    Google Scholar 

  3. Freeman, S.: Partial revelation and Modula-3. Dr. Dobb’s Journal 20(10), 36–42 (1995)

    Google Scholar 

  4. Ingalls, D., Kaehler, T., Maloney, J., Wallace, S., Kay, A.: Back to the future: The story of Squeak, A practical Smalltalk written in itself. In: Proceedings OOPSLA 1997, November 1997, pp. 318–326. ACM Press, New York (1997)

    Chapter  Google Scholar 

  5. Kniesel, G.: Type-safe delegation for run-time component adaptation. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 351–366. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  6. Lamping, J.: Typing the specialization interface. In: Proceedings OOPSLA 1993, October 1993. ACM SIGPLAN Notices, vol. 28, pp. 201–214 (1993)

    Google Scholar 

  7. Madsen, O.L., Moller-Pedersen, B., Nygaard, K.: Object- Oriented Programming in the Beta Programming Language. Addison Wesley, Reading (1993)

    Google Scholar 

  8. Mezini, M., Ostermann, K.: Integrating independent components with ondemand remodularization. In: Proceedings OOPSLA 2002, November 2002, pp. 52–67 (2002)

    Google Scholar 

  9. Mikhajlov, L., Sekerinski, E.: A study of the fragile base class problem. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 355–383. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  10. The Microsoft Developer Network, http://msdn.microsoft.com/

  11. Nierstrasz, O.: A survey of object-oriented concepts. In: Kim, W., Lochovsky, F. (eds.) Object-Oriented Concepts, Databases and Applications, pp. 3–21. ACM Press and Addison Wesley, Reading, Mass (1989)

    Google Scholar 

  12. Sadeh, B., Ducasse, S.: Adding dynamic interface to Smalltalk. Journal of Object Technology 1(1) (2002)

    Google Scholar 

  13. Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable units of behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  14. Snyder, A.: Encapsulation and inheritance in object-oriented programming languages. In: Proceedings OOPSLA ’86, November 1986. ACM SIGPLAN Notices, vol. 21, pp. 38–45 (1986)

    Google Scholar 

  15. Steyaert, P., Lucas, C., Mens, K., D’Hondt, T.: Reuse contracts: Managing the evolution of reusable assets. In: Proceedings of OOPSLA 1996 Conference, pp. 268–285. ACM Press, New York (1996)

    Google Scholar 

  16. Tucker Taft, S.: Ada 9x: From abstraction-oriented to object-oriented. In: Proceedings OOPSLA 1993, October 1993, vol. 28, pp. 127–143 (1993)

    Google Scholar 

  17. Taivalsaari, A.: On the notion of inheritance. ACM Computing Surveys 28(3), 438–479 (1996)

    Article  Google Scholar 

  18. Viega, J., Reynolds, P., Behrends, R.: Automating delegation in classbased languages. In: Proceedings of TOOLS 34’00, July 2000, pp. 171–182 (2000)

    Google Scholar 

  19. Wolczko, M.: Encapsulation, delegation and inheritance in object-oriented languages. IEEE Software Engineering Journal 7(2), 95–102 (1992)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Schärli, N., Ducasse, S., Nierstrasz, O., Wuyts, R. (2004). Composable Encapsulation Policies. In: Odersky, M. (eds) ECOOP 2004 – Object-Oriented Programming. ECOOP 2004. Lecture Notes in Computer Science, vol 3086. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24851-4_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24851-4_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22159-3

  • Online ISBN: 978-3-540-24851-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics