Skip to main content

McJava – A Design and Implementation of Java with Mixin-Types

  • Conference paper
Book cover Programming Languages and Systems (APLAS 2004)

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

Included in the following conference series:

Abstract

A programming construct mixin was invented to implement uniform extensions and modifications to classes. Although mixin-based programming has been extensively studied both on the methodological and theoretical point of views, relatively few attempts have been made on designing real programming languages that support mixins. In this paper, we address the issue of how to introduce a feature of declaring a mixin that may also be used as a type to nominally typed object-oriented languages like Java. We propose a programming language McJava, an extension of Java with mixin-types. To study type-soundness of McJava, we have formulated the core of McJava with typing and reduction rules, and proved its type-soundness. We also describe a compilation strategy of McJava that translates McJava programs to Java programs thus eventually making it runnable on standard Java virtual machines.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. GCC home page, http://gcc.gnu.org/

  2. Allen, E., Bannet, J., Cartwright, R.: A first-class approach to genericity. In: Proceedings of OOPSLA 2003, pp. 96–114 (2003)

    Google Scholar 

  3. 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 

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

    Article  MathSciNet  MATH  Google Scholar 

  5. AspectJ, http://www.eclipse.org/aspectj/

  6. Bono, V., Patel, A., Shmatikov, V.: A Core Calculus of Classes and Mixins. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 43–66. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  7. Bracha, G.: The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. PhD thesis, University of Utah (1992)

    Google Scholar 

  8. Bracha, G., Cook, W.: Mixin-based inheritance. In: OOPSLA 1990, pp. 303–311 (1990)

    Google Scholar 

  9. Bracha, G., Lindstrom, G.: Modularity meets inheritance. In: Proceedings of the IEEE Computer Society International Conference on Computer Languages, pp. 282–290. IEEE Computer Society, Los Alamitos (1992)

    Google Scholar 

  10. Duggan, D., Sourelis, C.: Mixin modules. In: ICFP 1996, pp. 262–272 (1996)

    Google Scholar 

  11. Duggan, D., Techaubol, C.-C.: Modular mixin-based inheritance for application frameworks. In: OOPSLA 2001, pp. 223–240 (2001)

    Google Scholar 

  12. Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: Proceedings of ICFP 1998, pp. 98–104 (1998)

    Google Scholar 

  13. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: POPL 1998, pp. 171–183 (1998)

    Google Scholar 

  14. Ichisugi, Y., Tanaka, A.: Difference-Based Modules: A Class-Independent Module Mechanism. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 62–88. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001)

    Article  Google Scholar 

  16. Kamina, T., Tamai, T.: A core calculus for mixin-types. In: Foundations on Object Oriented Languages (FOOL11) (2004), Revised version, available at: http://www.graco.c.u-tokyo.ac.jp/~kamina/papers/fool/kamina.pdf

  17. Kiczales, G., des Rivieres, J., Bobrow, D.G.: The Arts of the Metaobject Protocol. MIT Press, Cambridge (1991)

    Google Scholar 

  18. Liskov, B.H., Wing, J.M.: A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems (TOPLAS) 16(6), 1811–1841 (1994)

    Article  Google Scholar 

  19. McDirmid, S., Flatt, M., Hsieh, W.C.: Jiazzi: New-age components for old-fashioned Java. In: Proceedings of OOPSLA 2001, pp. 211–222 (2001)

    Google Scholar 

  20. Moon, D.A.: Object-oriented programming with flavors. In: OOPSLA 1986 Conference Proceedings: Object-Oriented Programming: Systems, Languages, and Applications, pp. 1–8 (1986)

    Google Scholar 

  21. 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 

  22. Smaragdakis, Y., Batory, D.: Implementing Layered Designs with Mixin Layers. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 550–570. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  23. Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley, Reading (1997)

    MATH  Google Scholar 

  24. Tamai, T.: Objects and roles: modeling based on the dualistic view. Information and Software Technology 41(14), 1005–1010 (1999)

    Article  Google Scholar 

  25. Tamai, T.: Evolvable Programming based on Collaboration-Field and Role Model. In: International Workshop on Principles of Software Evolution (IWPSE 2002), pp. 1–5 (2002)

    Google Scholar 

  26. Ubayashi, N., Tamai, T.: Separation of Concerns in Mobile Agent Applications. In: Yonezawa, A., Matsuoka, S. (eds.) Reflection 2001. LNCS, vol. 2192, pp. 89–109. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  27. VanHislt, M., Notkin, D.: Using C++ templates to implement role-based designs. In: JSSST International Symposium on Object Technologies for Advanced Software, pp. 22–37. Springer, Heidelberg (1996)

    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

Kamina, T., Tamai, T. (2004). McJava – A Design and Implementation of Java with Mixin-Types. In: Chin, WN. (eds) Programming Languages and Systems. APLAS 2004. Lecture Notes in Computer Science, vol 3302. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30477-7_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30477-7_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23724-2

  • Online ISBN: 978-3-540-30477-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics