skip to main content
10.1145/1297027.1297064acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
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

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 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
  • 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
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 October 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

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

Qualifiers

  • Article

Conference

OOPSLA07
Sponsor:

Acceptance Rates

OOPSLA '07 Paper Acceptance Rate 33 of 156 submissions, 21%;
Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)2
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

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