Skip to main content

Featherweight Jigsaw: A Minimal Core Calculus for Modular Composition of Classes

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

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

Included in the following conference series:

  • 1530 Accesses

Abstract

We present FJig, a simple calculus where basic building blocks are classes in the style of Featherweight Java, declaring fields, methods and one constructor. However, inheritance has been generalized to the much more flexible notion originally proposed in Bracha’s Jigsaw framework. That is, classes play also the role of modules, that can be composed by a rich set of operators, all of which can be expressed by a minimal core.

We keep the nominal approach of Java-like languages, that is, types are class names. However, a class is not necessarily a structural subtype of any class used in its defining expression.

The calculus allows the encoding of a large variety of different mechanisms for software composition in class-based languages, including standard inheritance, mixin classes, traits and hiding. Hence, FJig can be used as a unifying framework for analyzing existing mechanisms and proposing new extensions.

We provide two different semantics of an FJig program: flattening and direct semantics. The difference is analogous to that between two intuitive models to understand inheritance: the former where inherited methods are copied into heir classes, and the latter where member lookup is performed by ascending the inheritance chain. Here we address equivalence of these two views for a more sophisticated composition mechanism.

This work has been partially supported by MIUR EOS DUE - Extensible Object Systems for Dynamic and Unpredictable Environments.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Ancona, D., Lagorio, G., Zucca, E.: Jam–designing a Java extension with mixins. ACM Transactions on Programming Languages and Systems 25(5), 641–712 (2003)

    Article  Google Scholar 

  2. Ancona, D., Zucca, E.: Overriding operators in a mixin-based framework. In: Hartel, P.H., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292. Springer, Heidelberg (1997)

    Google Scholar 

  3. Ancona, D., Zucca, E.: A calculus of module systems. Journ. of Functional Programming 12(2), 91–132 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  4. Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Stateful traits. In: De Meuter, W. (ed.) ISC 2006. LNCS, vol. 4406, pp. 66–90. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  5. Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Stateful traits and their formalization. Comput. Lang. Syst. Struct. 34(2-3), 83–108 (2008)

    Google Scholar 

  6. Bono, V., Damiani, F., Giachino, E.: Separating type, behavior, and state to achieve very fine-grained reuse. In: 9th Intl. Workshop on Formal Techniques for Java-like Programs (2007)

    Google Scholar 

  7. Bono, V., Damiani, F., Giachino, E.: On traits and types in a Java-like setting. In: TCS 2008 - IFIP Int. Conf. on Theoretical Computer Science. Springer, Heidelberg (2008)

    Google Scholar 

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

    Google Scholar 

  9. Duggan, D., Sourelis, C.: Mixin modules. In: Intl. Conf. on Functional Programming 1996. ACM Press, New York (1996)

    Google Scholar 

  10. Fisher, K., Reppy, J.: A typed calculus of traits. In: FOOL 2004 - Intl. Workshop on Foundations of Object Oriented Languages (2004)

    Google Scholar 

  11. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: ACM Symp. on Principles of Programming Languages 1998. ACM Press, New York (1998)

    Google Scholar 

  12. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.M.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional Computing Series. Addison-Wesley, Reading (1995)

    MATH  Google Scholar 

  13. Hirschowitz, T., Leroy, X.: Mixin modules in a call-by-value setting. In: Le Métayer, D. (ed.) ESOP 2002. LNCS, vol. 2305, pp. 6–20. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  14. Hirschowitz, T., Leroy, X., Wells, J.B.: Call-by-value mixin modules. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 64–78. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  15. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)

    Article  Google Scholar 

  16. Lagorio, G., Servetto, M., Zucca, E.: Featherweight Jigsaw - a minimal core calculus for modular composition of classes. Technical report, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova (December 2008) (Full version)

    Google Scholar 

  17. Lagorio, G., Servetto, M., Zucca, E.: Flattening versus direct semantics for Featherweight Jigsaw. In: FOOL 2009 - Intl. Workshop on Foundations of Object Oriented Languages (2009)

    Google Scholar 

  18. Leavens, G.T.: Tutorial on JML, the Java modeling language. In: Automated Software Engineering (ASE 2007). ACM Press, New York (2007)

    Google Scholar 

  19. Liquori, L., Spiwack, A.: FeatherTrait: A modest extension of Featherweight Java. ACM Transactions on Programming Languages and Systems 30(2) (2008)

    Google Scholar 

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

    Google Scholar 

  21. Wells, J.B., Vestergaard, R.: Confluent equational reasoning for linking with first-class primitive modules. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, p. 412. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lagorio, G., Servetto, M., Zucca, E. (2009). Featherweight Jigsaw: A Minimal Core Calculus for Modular Composition of Classes . In: Drossopoulou, S. (eds) ECOOP 2009 – Object-Oriented Programming. ECOOP 2009. Lecture Notes in Computer Science, vol 5653. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03013-0_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03013-0_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03012-3

  • Online ISBN: 978-3-642-03013-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics