Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

The java module system: core design and semantic definition

Published: 21 October 2007 Publication History

Abstract

Java has no module system. Its packages only subdivide the class name space, allowing only a very limited form of component-level information hiding and reuse. Two Java Community Processes have started addressing this problem: one describes the runtime system and has reached an early draft stage, while the other considers the developer's view and only has a straw-man proposal. Both are natural language documents, which inevitably contain ambiguities.
In this work we design and formalize a core module system for Java. Where the JCP documents are complete, we follow them closely; elsewhere we make reasonable choices. We define the syntax, the type system, and the operational semantics of an LJAM language, defining these rigorously in the Isabelle/HOL automated proof assistant. Using this formalization, we identify various issues with the module system. We highlight the underlying design decisions, and discuss several alternatives and their benefits. Our Isabelle/HOL definitions should provide a basis for further consideration of the design alternatives, for reference implementations, and for proofs of soundness.

References

[1]
Apache Felix. http://cwiki.apache.org/felix/.
[2]
Eclipse Callisto. http://www.eclipse.org/callisto/.
[3]
Equinox. http://www.eclipse.org/equinox/.
[4]
Fusion. http://en.wikipedia.org/wiki/.NET_assembly#Fusion.
[5]
Ancona, D., Damiani, F., Drossopoulou, S., and Zucca, E. Polymorphic Bytecode: Compositional Compilation for Java-like Languages. In Proc32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL'05 (Long Beach, CA, USA, Jan12-14, 2005), J. Palsberg and M. Abadi, Eds., ACM, pp. 26--37.
[6]
Ancona, D., Lagorio, G., and Zucca, E. Jam -a smooth extension of java with mixins. In ProcEuropean Conference on Object-Oriented Programming, ECOOP'00 (Sophia Antipolis and Cannes, France, June 12--16, 2000), E. Bertino, Ed., vol. 1850 of Lecture Notes in Computer Science, Springer, pp. 154--178.
[7]
Ancona, D., Lagorio, G., and Zucca, E. Smart Modules for Java-like Languages. In Proc7th Workshop on Formal Techniques for Java-like Programs, FTfJP'05 (Glasgow, Scotland, July 26, 2005).
[8]
Ancona, D., and Zucca, E. True Modules for Java-like Languages. In ProcEuropean Conference on Object-Oriented Programming, ECOOP'01 (Budapest, Hungary, June18-22, 2001), JL. Knudsen, Ed., vol. 2072 of Lecture Notes in Computer Science, Springer, pp. 354--380.
[9]
Bierman, G., Parkinson, M., and Pitts, A. MJ: An imperative core calculus for Java and Java with Effects. Tech. Rep. 563, Cambridge University Computer Laboratory, Apr. 2003.
[10]
Bracha, G. Developing Modules for Development. http://blogs.sun.com/gbracha/, Mar. 2006.
[11]
Bracha, G. Superpackages: Development Modules in Dolphin. In ProcJavaOneSM Conference (2006), Sun Microsystems, Inc.
[12]
Corwin, J., Bacon, D. F., Grove, D., and Murthy, C. MJ: a rational module system for Java and its applications. In ProcACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, OOPSLA'03(Anaheim, CA, USA, Oct. 26--30, 2003), RCrocker and GLS. Jr., Eds., ACM, pp. 241--254.
[13]
DevelopMentor. Assemblies Module -.NET: Building Applications and Components with C#, Jan. 2004.
[14]
Flatt, M., Krishnamurthi, S., and Felleisen, M. A Programmer's reduction semantics for classes and mixins. Tech. Rep. TR-97-293, Rice University, 1997. Corrected June, 1999.
[15]
Gosling, J., Joy, B., Stelle, G., and Bracha, G. The Java™ Language Specification, Third. ed. Sun Microsystems, Inc., May 2005.
[16]
Igarashi, A., Pierce, B. C., and Wadler, P. Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23, 3 (2001), 396--450.
[17]
Klein, G., and Nipkow, T. A Machine-Checked Model for a Java-Like Language, Virtual Machine and Compiler. ACM Transactions on Programming Languages and Systems, TOPLAS'06 28, 4 (July 2006), 619--695.
[18]
Liang, S., and Bracha, G. Dynamic Class Loading in the Java Virtual Machine. In ProcACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, OOPSLA'98 (Vancouver, British Columbia, Canada, Oct. 18--22, 1998), pp. 36--44.
[19]
McDirmid, S., Flatt, M., and Hsieh, W. Jiazzi: New Age Components for Old Fashioned Java. In ProcACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, OOPSLA'01 (Tampa, Florida, USA, Nov. 2001), vol. 36, pp. 211--222.
[20]
Microsoft. C# Specification, 2.0 ed., Sept. 2005.
[21]
Nipkow, T., Paulson, L. C., and Wenzel, M. Isabelle/HOL -A Proof Assistant for Higher-Order Logic, vol. 2283 of Lecture Notes in Computer Science. Springer, 2002.
[22]
OSGi™ Alliance. About the OSGi Service Platform, 4.1 ed., Nov. 2005.
[23]
Robinson, R. Developing and Deploying Modular J2EE Applications with WebSphere Studio Application Developer and WebSphere Application Server. http://www-128.ibm.com/developerworks/websphere/library/techarticles/02%06_robinson/robinson.html, June 2002.
[24]
Seco, J. C., and Caires, L. A Basic Model of Typed Components. In ProcEuropean Conference on Object-Oriented Programming, ECOOP'00 (Sophia Antipolis and Cannes, France, June 12--16, 2000), E. Bertino, Ed., vol. 1850 of Lecture Notes in Computer Science, Springer, pp. 108--128.
[25]
Sewell, P., Zappa Nardelli, F., Owens, S., Peskine, G., Ridge, T., Sarkar, S., and Strniša, R. Ott: Effective Tool Support for the Working Semanticist. In ProcICFP (Freiburg, Germany, Oct. 2007). To appear in ICFP'07.
[26]
Strniša, R. Lightweight Java Module System. http://www.cl.cam.ac.uk/~rs456/ljam, Feb. 2007.
[27]
Strniša, R., and Parkinson, M. Lightweight Java. http://www.cl.cam.ac.uk/~rs456/lj, Sept. 2006.
[28]
Sun Microsystems, Inc. Java™ SE 7. https://jdk7.dev.java.net/. In development.
[29]
Sun Microsystems, Inc. JSR-294: Improved Modularity Support in the Java™ Programming Language. http://jcp.org/en/jsr/detail?id=294.
[30]
Sun Microsystems, Inc. OpenJDK: Modules project. http://openjdk.java.net/projects/modules/.
[31]
Sun Microsystems, Inc. JSR-277: Java™ Module System. http://jcp.org/en/jsr/detail?id=277, Oct. 2006. Early Draft.
[32]
Zenger, M. Programming Language Abstractions for Extensible Software Components. PhD thesis, University of Lausanne, EPFL, 2003.

Cited By

View all
  • (2023)An empirical analysis for software robustness vulnerability in terms of modularity qualitySystems Engineering10.1002/sys.2168626:6(754-769)Online publication date: 18-Apr-2023
  • (2022)Using artificial neural networks to provide guidance in extending PL/SQL programsSoftware Quality Journal10.1007/s11219-022-09586-130:4(885-916)Online publication date: 19-Mar-2022
  • (2019)IVY 2Proceedings of the ACM SIGCHI Symposium on Engineering Interactive Computing Systems10.1145/3319499.3328228(1-6)Online publication date: 18-Jun-2019
  • Show More Cited By

Recommendations

Reviews

Alexandre Bergel

The use of packages and class loaders in Java does not help in managing several different versions of the same software unit in a satisfactory way. As expressed by the authors, this situation is traditionally referenced as dynamic-link library (DLL) or Java Archive (JAR) hell. Java Module System (JAM) is the latest of several attempts by the Java community to define a practical module system. The main feature of JAM is to add visibility restriction to packages using hierarchical information hiding, while being backward compatible with Java. JAM supports "super package," a new kind of compilation unit, to embody packages. Packages may be imported and exported to other super packages. A repository acts as a scoping mechanism by containing one module instance at most. A module definition (no matter what version) can be found from within the same repository, or any repository related to that repository through the "child" relation. The authors present a rigorous formalization and an extended discussion on various aspects of JAM. Other module systems, such as MZScheme's units [1] and Expanders [2], enable different class versions to be in use in the same executing application. JAM restricts one single module instance per repository, which implies that no more than one class version may be present at execution within the same control flow. One point that may leave a reader unsure has to do with interaction with legacy code. Recent major changes in Java, such as generics, show the importance of linking legacy code to new libraries that use the new features, and vice versa. The paper does not provide any convincing hints that go in that direction. With that said, this paper makes a strong and clear contribution, and provides an answer for a pressing need. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 42, Issue 10
Proceedings of the 2007 OOPSLA conference
October 2007
686 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1297105
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications
    October 2007
    728 pages
    ISBN:9781595937865
    DOI:10.1145/1297027
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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 October 2007
Published in SIGPLAN Volume 42, Issue 10

Check for updates

Author Tags

  1. JAM
  2. LJAM
  3. java
  4. module
  5. superpackage

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)26
  • Downloads (Last 6 weeks)5
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2023)An empirical analysis for software robustness vulnerability in terms of modularity qualitySystems Engineering10.1002/sys.2168626:6(754-769)Online publication date: 18-Apr-2023
  • (2022)Using artificial neural networks to provide guidance in extending PL/SQL programsSoftware Quality Journal10.1007/s11219-022-09586-130:4(885-916)Online publication date: 19-Mar-2022
  • (2019)IVY 2Proceedings of the ACM SIGCHI Symposium on Engineering Interactive Computing Systems10.1145/3319499.3328228(1-6)Online publication date: 18-Jun-2019
  • (2013)Modules as gradually-typed objectsProceedings of the 7th Workshop on Dynamic Languages and Applications10.1145/2489798.2489799(1-8)Online publication date: 1-Jul-2013
  • (2010)OttJournal of Functional Programming10.1017/S095679680999029320:1(71-122)Online publication date: 1-Jan-2010
  • (2023)Variability modulesJournal of Systems and Software10.1016/j.jss.2022.111510195:COnline publication date: 1-Jan-2023
  • (2021)A Formal Framework of Software Product Line AnalysesACM Transactions on Software Engineering and Methodology10.1145/344238930:3(1-37)Online publication date: 23-Apr-2021
  • (2018)Optimizing Software Modularity with Minimum Possible VariationsJournal of Intelligent Systems10.1515/jisys-2018-023129:1(1135-1150)Online publication date: 4-Dec-2018
  • (2018)An empirical evaluation of OSGi dependencies best practices in the eclipse IDEProceedings of the 15th International Conference on Mining Software Repositories10.1145/3196398.3196416(170-180)Online publication date: 28-May-2018
  • (2017)An Extension of the ABS Toolchain with a Mechanism for Type Checking SPLsIntegrated Formal Methods10.1007/978-3-319-66845-1_8(111-126)Online publication date: 27-Aug-2017
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media