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.
Preview
Unable to display preview. Download preview PDF.
References
GCC home page, http://gcc.gnu.org/
Allen, E., Bannet, J., Cartwright, R.: A first-class approach to genericity. In: Proceedings of OOPSLA 2003, pp. 96–114 (2003)
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)
Ancona, D., Zucca, E.: A theory of mixin modules: Basic and derived operators. Mathematical Structures in Computer Science 8(4), 401–446 (1998)
AspectJ, http://www.eclipse.org/aspectj/
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)
Bracha, G.: The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. PhD thesis, University of Utah (1992)
Bracha, G., Cook, W.: Mixin-based inheritance. In: OOPSLA 1990, pp. 303–311 (1990)
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)
Duggan, D., Sourelis, C.: Mixin modules. In: ICFP 1996, pp. 262–272 (1996)
Duggan, D., Techaubol, C.-C.: Modular mixin-based inheritance for application frameworks. In: OOPSLA 2001, pp. 223–240 (2001)
Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: Proceedings of ICFP 1998, pp. 98–104 (1998)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: POPL 1998, pp. 171–183 (1998)
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)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001)
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
Kiczales, G., des Rivieres, J., Bobrow, D.G.: The Arts of the Metaobject Protocol. MIT Press, Cambridge (1991)
Liskov, B.H., Wing, J.M.: A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems (TOPLAS) 16(6), 1811–1841 (1994)
McDirmid, S., Flatt, M., Hsieh, W.C.: Jiazzi: New-age components for old-fashioned Java. In: Proceedings of OOPSLA 2001, pp. 211–222 (2001)
Moon, D.A.: Object-oriented programming with flavors. In: OOPSLA 1986 Conference Proceedings: Object-Oriented Programming: Systems, Languages, and Applications, pp. 1–8 (1986)
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)
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)
Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley, Reading (1997)
Tamai, T.: Objects and roles: modeling based on the dualistic view. Information and Software Technology 41(14), 1005–1010 (1999)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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