Skip to main content

Jam - A Smooth Extension of Java with Mixins

  • Conference paper
  • First Online:

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

Abstract

In this paper we present Jam, an extension of the Java language supporting mixins, that is, parametric heir classes. A mixin declaration in Jam is similar to a Java heir class declaration, except that it does not extend a fixed parent class, but simply specifies the set of fields and methods a generic parent should provide. In this way, the same mixin can be instantiated on many parent classes, producing different heirs, thus avoiding code duplication and largely improving modularity and reuse. Moreover, as happens for classes and interfaces, mixin names are reference types, and all the classes obtained instantiating the same mixin are considered subtypes of the corresponding type, hence can be handled in a uniform way through the common interface. This possibility allows a programming style where different ingredients are “mixed” together in defining a class; this paradigm is somehow similar to that based on multiple inheritance, but avoids the associated complications.

The language has been designed with the main objective in mind to obtain, rather than a new theoretical language, a working and smooth extension of Java. That means, on the design side, that we have faced the challenging problem of integrating the Java overall principles and complex type system with this new notion; on the implementation side, that we have developed a Jam to Java translator which makes Jam sources executable on every Java Virtual Machine.

Partially supported by Murst - Tecniche formali per la specifica, l’analisi, la verifica, la sintesi e la trasformazione di sistemi software

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. D. Ancona, G. Lagorio, and E. Zucca. Jam-A smooth extension of Java with mixins. Technical report, DISI-TR-99-15, University of Genova, November 1999. Available at http://www.disi.unige.it/ftp/person/AnconaD/Jam.ps.gz.

  2. D. Ancona and E. Zucca. A theory of mixin modules: basic and derived operators. Mathematical Structures in Computer Science, 8(4):401–446, 1998.

    Article  MATH  MathSciNet  Google Scholar 

  3. D. Ancona and E. Zucca. A primitive calculus for module systems. In G. Nadathur, editor, Principles and Practice of Declarative Programming, 1999, Lecture Notes in Computer Science, pages 62–79. Springer Verlag, 1999.

    Chapter  Google Scholar 

  4. G. Banavar and G. Lindstrom. An application framework for module composition tools. In ECOOP’ 96, number 1098 in Lecture Notes in Computer Science, pages 91–113. Springer Verlag, July 1996.

    Google Scholar 

  5. G. Bracha. The Programming Language JIGSAW: Mixins, Modularity and Multiple Inheritance. PhD thesis, Department of Comp. Sci., Univ. of Utah, 1992.

    Google Scholar 

  6. G. Bracha and W. Cook. Mixin-based inheritance. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1990, pages 303–311. ACM Press, October 1990. SIGPLAN Notices, volume 25, number 10.

    Google Scholar 

  7. G. Bracha and D. Griswold. Extending Smalltalk with mixins. In OOPSLA96 Workshop on Extending the Smalltalk Language, April 1996. Electronic note available at http://www.javasoft.com/people/gbracha/mwp.html.

  8. G. Bracha and G. Lindstrom. Modularity meets inheritance. In Proc. International Conference on Computer Languages, pages 282–290, San Francisco, April 1992. IEEE Computer Society.

    Google Scholar 

  9. G. Bracha, M. Odersky, D. Stoutmire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1998, October 1998. Home page: http://www.cs.bell-labs.com/who/wadler/pizza/gj/

  10. S. Drossopoulou and S. Eisenbach. Describing the semantics of Java and proving type soundness. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, number 1523 in Lecture Notes in Computer Science, pages 41–82. Springer Verlag, Berlin, 1999.

    Chapter  Google Scholar 

  11. S. Drossopoulou, T. Valkevych, and S. Eisenbach. Java type soundness revisited. Technical report, Dept. of Computing-Imperial College of Science, Technology and Medicine, October 1999.

    Google Scholar 

  12. D. Duggan and C. Sourelis. Mixin modules. In Intl. Conf. on Functional Programming, pages 262–273, Philadelphia, June 1996. ACM Press. SIGPLAN Notices, volume 31, number 6.

    Google Scholar 

  13. M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In ACM Symp. on Principles of Programming Languages 1998, pages 171–183, January 1998.

    Google Scholar 

  14. James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, 1996.

    Google Scholar 

  15. S.C. Keene. Object Oriented Programming in Common Lisp: A Programming Guide in CLOS. Addison-Wesley, 1989.

    Google Scholar 

  16. A.C. Meyers, J.A. Bank, and B. Liskov. Parameterized types for Java. In Proc. 24th ACM Symp. on Principles of Programming Languages. ACM Press, January 1997.

    Google Scholar 

  17. D.A. Moon. Object oriented programming with Flavors. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1986, pages 1–8, 1986.

    Google Scholar 

  18. M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In ACM Symp. on Principles of Programming Languages 1997. January 1997.

    Google Scholar 

  19. A. Snyder. CommonObjects: An overview. SIGPLAN Notices, 21(10):19–28, 1986.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ancona, D., Lagorio, G., Zucca, E. (2000). Jam - A Smooth Extension of Java with Mixins. In: Bertino, E. (eds) ECOOP 2000 — Object-Oriented Programming. ECOOP 2000. Lecture Notes in Computer Science, vol 1850. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45102-1_8

Download citation

  • DOI: https://doi.org/10.1007/3-540-45102-1_8

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67660-7

  • Online ISBN: 978-3-540-45102-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics