Advertisement

True Modules for Java-like Languages

  • Davide Ancona
  • Elena Zucca
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2072)

Abstract

We present JavaMod, a true module system constructed on top of a Java-like language. More in detail, this means that basic modules are collections of Java classes and specify in their interface the imported and exported classes with their types; furthermore, it is possible to write structured module expressions by means of a set of module operators and a type system at the module level ensures type safety. In designing such a type system, one has to face non trivial problems, notably the fact that a module M which extends an imported class C can be correctly combined only with modules exporting a class C which, besides providing the expected services, causes no interferences with its subclasses defined in M. What we obtain is a module language which is extremely flexible and allows to express (without any need of enriching the syntax of the core level, that is, the Java language), for instance, generic types as in Pizza and GJ, mixin classes (that is, subclasses parametric in the direct superclass) and mutually recursive class definitions split in independent modules.

Key word

Software Testing Object-Oriented Modeling UML Test Economics Test Cost Integration Testing Graph Algorithms Stub Minimization 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    D. Ancona, G. Lagorio, and E. Zucca. Jam: A smooth extension of Java with mixins. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 154–178, Berlin, 2000. Springer Verlag.Google Scholar
  2. [2]
    D. Ancona and E. Zucca. A theory of mixin modules: Basic and derived operators. Mathematical Structures in Computer Science, 8(4):401–446, August 1998.zbMATHCrossRefMathSciNetGoogle Scholar
  3. [3]
    D. Ancona and E. Zucca. A calculus of module systems. Technical Report DISITR-99-09, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova, 1999. Submitted for journal publication. Extended version of [4].Google Scholar
  4. [4]
    D. Ancona and E. Zucca. A primitive calculus for module systems. In G. Nadathur, editor, PPDP’-Principles and Practice of Declarative Programming, number 1702 in Lecture Notes in Computer Science, pages 62–79, Berlin, 1999. Springer Verlag.CrossRefGoogle Scholar
  5. [5]
    D. Ancona and E. Zucca. True modules for Java-like languages: Design and foundations. Technical Report DISI-TR-00-12, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova, August 2000.Google Scholar
  6. [6]
    L. Bauer, A.W. Appel, and E.W. Felten. Mechanisms for secure modular programming in Java. Technical Report CS-TR-603-99, Department of Computer Science, Princeton University, July 1999.Google Scholar
  7. [7]
    V. Bono, A. Patel, and V. Shmatikov. A core calculus of classes and mixins. In R. Guerraoui, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1628 in Lecture Notes in Computer Science, pages 43–66, Berlin, 1999. Springer Verlag.Google Scholar
  8. [8]
    G. Bracha and W. Cook. Mixin-based inheritance. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1990, pages 303–311. ACM Press, October 1990. SIGPLAN Notices, volume 25, number 10.Google Scholar
  9. [9]
    G. Bracha and G. Lindstrom. Modularity meets inheritance. In Proc. International Conference on Computer Languages, pages 282–290, San Francisco, April 1992. IEEE Computer Society.Google Scholar
  10. [10]
    G. 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, October 1998. Home page: http://www.cs.bell-labs.com/who/wadler/pizza/gj/.
  11. [11]
    M. Büchi and W. Weck. Generic wrapping. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 201–225. Springer Verlag, 2000.Google Scholar
  12. [12]
    K. Crary, R. Harper, and S. Puri. What is a recursive module? In PLDI’99-ACM Conf. on Programming Language Design and Implementation, 1999.Google Scholar
  13. [13]
    S. Drossopoulou and S. Eisenbach. Describing the semantics of Java and proving type soundness. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, number 1523 in Lecture Notes in Computer Science, pages 41–82. Springer Verlag, Berlin, 1999.CrossRefGoogle Scholar
  14. [14]
    D. Duggan. A mixin-based, semantics-based approach to reusing domain-specific programming languages. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 179–200. Springer Verlag, 2000.Google Scholar
  15. [15]
    D. Duggan and C. Sourelis. Mixin modules. In Intl. Conf. on Functional Programming, pages 262–273, Philadelphia, June 1996. ACM Press.Google Scholar
  16. [16]
    R.B. Findler and M. Flatt. Modular object-oriented programming with units and mixins. In Intl. Conf. on Functional Programming 1998, September 1998.Google Scholar
  17. [17]
    K. Fisher and J. Reppy. The design of a class mechanism for Moby. In PLDI’99-ACM Conf. on Programming Language Design and Implementation, pages 37–49, May 1999.Google Scholar
  18. [18]
    K. Fisher and J. Reppy. Extending Moby with inheritance-based subtyping. In European Symposium on Programming 2000, Lecture Notes in Computer Science, Berlin, 2000. Springer Verlag. To appear.Google Scholar
  19. [19]
    M. Flatt and M. Felleisen. Units: Cool modules for HOT languages. In PLDI’98-ACM Conf. on Programming Language Design and Implementation, pages 236–248, 1998.Google Scholar
  20. [20]
    M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In ACM Symp. on Principles of Programming Languages 1998, pages 171–183, January 1998.Google Scholar
  21. [21]
    J. Gosling, B. Joy, and G. Steele. The Java™ Language Specification. Addison-Wesley, 1996.Google Scholar
  22. [22]
    R. Harper and M. Lillibridge. A type theoretic approach to higher-order modules with sharing. In ACM Symp. on Principles of Programming Languages 1994, pages 127–137. ACM Press, 1994.Google Scholar
  23. [23]
    A. Igarashi, B. Pierce, and P. 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, November 1999.Google Scholar
  24. [24]
    X. Leroy. Manifest types, modules and separate compilation. In ACM Symp. on Principles of Programming Languages 1994, pages 109–122. ACM Press, 1994.Google Scholar
  25. [25]
    X. Leroy. A modular module system. Journal of Functional Programming, 10(3):269–303, May 2000.zbMATHCrossRefGoogle Scholar
  26. [26]
    B. Meyer. Eiffel: The language. Prentice Hall, 1992.Google Scholar
  27. [27]
    R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. The MIT Press, Cambridge, Massachussetts, 1990.Google Scholar
  28. [28]
    M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In ACM Symp. on Principles of Programming Languages 1997. ACM Press, January 1997.Google Scholar
  29. [29]
    D. Remy and J. Vouillon. Objective ML: An effective object-oriented extension to ML. Theory and Practice of Object Systems, 4(1): 27–50, 1998.CrossRefGoogle Scholar
  30. [30]
    C. Szyperski. Import is not inheritance. why we need both: Modules and classes. In O. Lehrmann Madsen, editor, ECOOP’92-European Conference on Object-Oriented Programming, number 615 in Lecture Notes in Computer Science, pages 19–32, Berlin, 1992. Springer Verlag.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Davide Ancona
    • 1
  • Elena Zucca
    • 1
  1. 1.DISI - Università di Genova Via DodecanesoGenovaItaly

Personalised recommendations