skip to main content
10.1145/2093157.2093172acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

DeepFJig: modular composition of nested classes

Published: 24 August 2011 Publication History

Abstract

We present a new language design which smoothly integrates modular composition and nesting of Java-like classes. That is, inheritance has been replaced by an expressive set of composition operators, inspired by Bracha's Jigsaw framework, and these operators allow to manipulate (e.g., rename or duplicate) a nested class at any level of depth. Typing is nominal as characteristic of Java-like languages, so types are paths of the form outern. c1.... ck which, depending on the class (node) where they occur, denote another node in the nesting tree. However, paths denoting the same class are not equivalent, since they behave differently w.r.t. composition operators.
The resulting language, called DeepFJig, obtains a great expressive power, allowing, e.g., to solve the expression problem, encode basic AOP mechanisms, and bring some refactoring techniques at the language level, while keeping a very simple semantics and type system which represent a natural extension for, say, a Java programmer.

References

[1]
Davide Ancona, Giovanni Lagorio, and Elena Zucca. Flexible type-safe linking of components for Java-like languages. In JMLC'06 - Joint Modular Languages Conference, volume 4228 of Lecture Notes in Computer Science, pages 136--154. Springer, 2006.
[2]
Davide Ancona and Elena Zucca. True modules for Java-like languages. In J. L. Knudsen, editor, ECOOP'01 - European Conference on Object-Oriented Programming, number 2072 in Lecture Notes in Computer Science, pages 354--380. Springer, 2001.
[3]
Davide Ancona and Elena Zucca. A calculus of module systems. Journ. of Functional Programming, 12(2):91--132, 2002.
[4]
Alexandre Bergel, Stéphane Ducasse, Oscar Nierstrasz, and Roel Wuyts. Stateful traits and their formalization. Comput. Lang. Syst. Struct., 34(2-3):83--108, 2008.
[5]
Gilad Bracha. The Programming Language JIGSAW: Mixins, Modularity and Multiple Inheritance. PhD thesis, Department of Comp. Sci., Univ. of Utah, 1992.
[6]
Gilad 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, pages 183--200. ACM Press, October 1998.
[7]
Gilad Bracha, Peter von der Ahé, Vassili Bykov, Yaron Kashai, William Maddox, and Eliot Miranda. Modules as objects in Newspeak. In Theo D'Hondt, editor, ECOOP'10 - Object-Oriented Programming, volume 6183 of Lecture Notes in Computer Science, pages 405--428. Springer, 2010.
[8]
Kim B. Bruce and J. Nathan Foster. LOOJ: Weaving LOOM into Java. In ECOOP'04 - Object-Oriented Programming, number 3086 in Lecture Notes in Computer Science, pages 389--413, 2004.
[9]
Kim B. Bruce, Martin Odersky, and Philip Wadler. A statically safe alternative to virtual types. In ECOOP'98 - European Conference on Object-Oriented Programming, number 1445 in Lecture Notes in Computer Science, pages 523--549, 1998.
[10]
Andrea Corradi, Marco Servetto, and Elena Zucca. DeepFJig - Modular composition of nested classes. In FOOL 2010 - Intl. Workshop on Foundations of Object-Oriented Languages, 2010.
[11]
Andrea Corradi, Marco Servetto, and Elena Zucca. DeepFJig - Modular composition of nested classes. Technical report, Dipartimento di Informatica e Scienze dell'Informazione, Università di Genova, April 2011.
[12]
Erik Ernst. gbeta -- a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Århus, Denmark, 1999.
[13]
Erik Ernst. Propagating class and method combination. In ECOOP'99 - European Conference on Object-Oriented Programming, number 1628 in Lecture Notes in Computer Science, pages 67--91. Springer, 1999.
[14]
Erik Ernst. The expression problem, scandinavian style. In MASPEGHI 2004 - Mechanisms for specialization, generalization and inheritance, 2004.
[15]
Erik Ernst, Klaus Ostermann, and William R. Cook. A virtual class calculus. In J. Gregory Morrisett and Simon L. Peyton Jones, editors, ACM Symp. on Principles of Programming Languages 2006, volume 41, pages 270--282. ACM Press, January 2006.
[16]
James Gosling, Bill Joy, Guy L. Steele, and Gilad Bracha. The Java language specification. The Java series. Addison-Wesley, third edition, 2005.
[17]
DeLesley Hutchins. Eliminating distinctions of class: using prototypes to model virtual classes. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2006), pages 1--20. ACM Press, 2006.
[18]
Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1999, pages 132--146. ACM Press, 1999.
[19]
Atsushi Igarashi, Chieri Saito, and Mirko Viroli. Lightweight family polymorphism. In Kwangkeun Yi, editor, APLAS 2005 - Asian Symposium on Programming Languages and Systems, volume 3780 of Lecture Notes in Computer Science, pages 161--177. Springer, 2005.
[20]
Atsushi Igarashi, Chieri Saito, and Mirko Viroli. Lightweight family polymorphism. Journ. of Functional Programming, 18(3):285--331, 2008.
[21]
Atsushi Igarashi and Mirko Viroli. Variant path types for scalable extensibility. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2007), pages 113--132. ACM Press, 2007.
[22]
Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Jørgen Lindskov Knudsen, editor, ECOOP'01 - European Conference on Object-Oriented Programming, number 2072 in Lecture Notes in Computer Science, pages 327--353. Springer, 2001.
[23]
Giovanni Lagorio, Marco Servetto, and Elena Zucca. Featherweight Jigsaw - a minimal core calculus for modular composition of classes. In Sophia Drossopoulou, editor, ECOOP'09 - Object-Oriented Programming, number 5653 in Lecture Notes in Computer Science. Springer, 2009.
[24]
Giovanni Lagorio, Marco Servetto, and Elena Zucca. Flattening versus direct semantics for Featherweight Jigsaw. In FOOL'09 - Intl. Workshop on Foundations of Object-Oriented Languages, 2009.
[25]
Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers. Scalable extensibility via nested inheritance. SIGPLAN Not., 39(10):99--115, 2004.
[26]
Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. J&: nested intersection for scalable software composition. SIGPLAN Not., 41(10):21--36, 2006.
[27]
M. Odersky and M. Zenger. Independently extensible solutions to the expression problem. In FOOL'05 - Intl. Workshop on Foundations of Object-Oriented Languages, 2005.
[28]
David L. Parnas. Designing software for ease of extension and contraction. In ICSE '78: Proceedings of the 3rd international conference on Software engineering, pages 264--277, Piscataway, NJ, USA, 1978. IEEE Press.
[29]
Nathanael Schärli. Traits --- Composing Classes from Behavioral Building Blocks. PhD thesis, University of Bern, February 2005.
[30]
Marco Servetto. MetaFJig - A Meta-Circular Composition Language for Java-like Classes. PhD thesis, Dipartimento di Informatica e Scienze dell'Informazione, Università di Genova, 2011. To appear.
[31]
Marco Servetto and Elena Zucca. MetaFJig - A meta-circular composition language for Java-like classes. In William R. Cook, Siobhán Clarke, and Martin C. Rinard, editors, ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2010), pages 464--483. ACM Press, 2010.
[32]
Mads Torgersen. The expression problem revisited. In Martin Odersky, editor, ECOOP'04 - Object-Oriented Programming, number 3086 in Lecture Notes in Computer Science, pages 123--143. Springer, 2004.
[33]
J. B. Wells and R. Vestergaard. Confluent equational reasoning for linking with first-class primitive modules. In ESOP 2000 - European Symposium on Programming 2000, number 1782 in Lecture Notes in Computer Science, pages 412--428. Springer, 2000.

Cited By

View all
  • (2019)Featherweight Jigsaw - Replacing inheritance by composition in Java-like languagesInformation and Computation10.1016/j.ic.2012.02.004214(86-111)Online publication date: 4-Jan-2019
  • (2016)Reflective Constraint WritingSpecial Issue on Database- and Expert-Systems Applications on Transactions on Large-Scale Data- and Knowledge-Centered Systems XXIV - Volume 951010.1007/978-3-662-49214-7_1(1-60)Online publication date: 1-Jan-2016
  • (2013)A meta-circular language for active librariesProceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation10.1145/2426890.2426913(117-126)Online publication date: 21-Jan-2013
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPPJ '11: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
August 2011
186 pages
ISBN:9781450309356
DOI:10.1145/2093157
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • DTU: Technical University of Denmark
  • ORACLE: ORACLE

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 August 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java
  2. module composition
  3. nested classes

Qualifiers

  • Research-article

Conference

PPPJ '11
Sponsor:
  • DTU
  • ORACLE
PPPJ '11: Principles and Practice of Programming in Java
August 24 - 26, 2011
Kongens Lyngby, Denmark

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2019)Featherweight Jigsaw - Replacing inheritance by composition in Java-like languagesInformation and Computation10.1016/j.ic.2012.02.004214(86-111)Online publication date: 4-Jan-2019
  • (2016)Reflective Constraint WritingSpecial Issue on Database- and Expert-Systems Applications on Transactions on Large-Scale Data- and Knowledge-Centered Systems XXIV - Volume 951010.1007/978-3-662-49214-7_1(1-60)Online publication date: 1-Jan-2016
  • (2013)A meta-circular language for active librariesProceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation10.1145/2426890.2426913(117-126)Online publication date: 21-Jan-2013
  • (2012)Challenges in the Design of the Package Template MechanismTransactions on Aspect-Oriented Software Development IX10.1007/978-3-642-35551-6_7(268-305)Online publication date: 2012

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media