Skip to main content

Chai: Traits for Java-Like Languages

  • Conference paper
ECOOP 2005 - Object-Oriented Programming (ECOOP 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3586))

Included in the following conference series:

Abstract

Traits support the factoring out of common behaviour, and its integration into classes in a manner that coexists smoothly with inheritance-based structuring mechanisms.

We designed the language Chai, which incorporates statically typed traits into a simple Java-inspired base language, and we discuss three versions of the language: Chai 1, where traits are only a mechanism for the creation of classes; Chai 2 where traits are a mechanism for the creation of classes, and can also introduce types, and Chai 3 where traits play a role at runtime, and can can be applied to objects, and change the objects’ behaviour. We give formal models for these languages, outline the proof of soundness, and our prototype implementation.

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. Agesen, O., Bak, L., Chambers, C., Chang, B.-W., Hölzle, U., Maloney, J., Smith, R.B., Ungar, D.: The Self 4.0 Programmer’s Reference Manual. Sun Microsystems, Inc (1995)

    Google Scholar 

  2. Ancona, D., Lagorio, G., Zucca, E.: Jam - A Smooth Extension of Java with Mixins. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, pp. 154–178. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  3. Black, A., Schärli, N., Ducasse, S.: Applying Traits to the Smalltalk Collection Hierarchy. In: ACM Conference on Object Oriented Systems, Languages and Applications (OOPSLA), October 2003, pp. 47–64 (2003)

    Google Scholar 

  4. Bracha, G.: The programming language jigsaw: mixins, modularity and multiple inheritance. PhD thesis, University of Utah (1992)

    Google Scholar 

  5. Bracha, G., Cook, W.: Mixin-Based Inheritance. In: Meyrowitz, N. (ed.) Proceedings of the Conference on Object-Oriented Programming: Systems, Languages, and Applications / Proceedings of the European Conference on Object-Oriented Programming, Ottawa, Canada, pp. 303–311. ACM Press, New York (1990)

    Chapter  Google Scholar 

  6. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the Future Safe for the Past: Adding Genericity to the Java Programming Language. In: Chambers, C. (ed.) ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), Vancouver, BC, pp. 183–200 (1998)

    Google Scholar 

  7. Drossopoulou, S., Damiani, F., Dezani-Ciancaglini, M., Giannini, P.: Fickle: Dynamic object re-classification. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 130–149. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  8. Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R.: Traits - Composable Units of Behaviour. University of Berne, Software Composition Group, http://www.iam.unibe.ch/~scg/Research/Traits/index.html

  9. Ernst, E.: Family Polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  10. Fisher, K., Reppy, J.: Statically Typed Traits. Technical Report TR-2003-13, Department of Computer Science, University of Chicago, December 2003. presented at FOOL (January 2004)

    Google Scholar 

  11. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and Mixins. In: Conference Record of POPL 1998: The 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, California, New York, pp. 171–183 (1998)

    Google Scholar 

  12. Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. In: Meissner, L. (ed.) Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages & Applications (OOPSLA 1999), N.Y, vol. 34(10), pp. 132–146 (1999)

    Google Scholar 

  13. Liquori, L., Spiwack, A.: Featherweight-Trait Java, A Trait-based Extension for FJ (2004), http://www-sop.inria.fr/mirho/Luigi.Liquori/PAPERS/ftj.ps.gz

  14. Meyer, B.: Eiffel: the Language. Prentice-Hall, Englewood Cliffs (1988)

    Google Scholar 

  15. Odersky, M., Altherr, P., Cremet, V., Emir, B., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E., Zenge, M.: The Scala Language Specification Version 1.0. Technical report, Programming Methods Laboratory, EPFL, Switzerland (2004)

    Google Scholar 

  16. Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A Nominal Theory of Objects with Dependent Types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  17. Quitslund, P.J., Black, A.P.: Java with Traits — Improving Opportunities for Reuse. In: Malenfant, J., Østvold, B.M. (eds.) ECOOP 2004. LNCS, vol. 3344. Springer, Heidelberg (2005)

    Google Scholar 

  18. Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable Units of Behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  19. Schärli, N., Nierstrasz, O., Ducasse, S., Wuyts, R., Black, A.: Traits: The Formal Model. Technical Report IAM-02-006, Institut für Informatik, Universität Bern, Switzerland (November 2002)

    Google Scholar 

  20. Smith, C.: Typed Traits, September. MSc thesis - Department of Computing. Imperial College, London (September 2004), http://chai-t.sourceforge.net/

  21. Stroustrup, B.: Multiple inheritance for C++. In: Proceedings of the Spring 1987 European Unix Users Group Conference, Helsinki (1987)

    Google Scholar 

  22. Ungar, D., Smith, R.B.: Self: The power of simplicity. In: Conference proceedings on Object-oriented programming systems, languages and applications, pp. 227–242. ACM Press, New York (1987)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Smith, C., Drossopoulou, S. (2005). Chai: Traits for Java-Like Languages. In: Black, A.P. (eds) ECOOP 2005 - Object-Oriented Programming. ECOOP 2005. Lecture Notes in Computer Science, vol 3586. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11531142_20

Download citation

  • DOI: https://doi.org/10.1007/11531142_20

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-27992-1

  • Online ISBN: 978-3-540-31725-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics