skip to main content
article

Component nextgen: a sound and expressive component framework for java

Published:21 October 2007Publication History
Skip Abstract Section

Abstract

Developing a general component system for a statically typed, object-oriented language is a challenging design problem for two reasons. First, mutually recursive references across components are common in object-oriented programs-an issue that has proven troublesome in the context of component systems for functional and procedural languages. Second, inheritance across component boundaries can cause accidental method overrides. Our recent research shows that a component framework can be constructed for a nominally typed object-oriented language supporting first-class generic types simply by adding appropriate annotations, syntactic sugar, and component-level type-checking. The fundamental semantic building blocks for constructing, type-checking and manipulating components are provided by the underlying first-class generic type system. To demonstrate the simplicity and utility of this approach we have designed and implemented an extension of Java called Component NEXTGEN (CGEN). CGEN, which is based on the Sun Java 5.0 javac compiler, is backwards compatible with existing Java binary code and runs on current Java Virtual Machines.

The primary contribution of this paper is a technical analysis of the subtle design issues involved in building a component framework for a nominally typed object-oriented language supporting first-class generics. In contrast to component systems for structurally typed languages, mutual recursion among components is accommodated in the type system and semantics without incorporating any special machinery. Our analysis includes a presentation of Core CGEN (CCG), a small, core language modeling the CGEN framework. It is based on Featherweight GJ and incorporates some ideas from MIXGEN. CCG adds the essential features to support components, but nothing more. Our discussion includes the type rules and semantics for CCG, as well as a proof of type safety.

References

  1. E. Allen, J. Bannet, and R. Cartwright. First-class genericity for Java. In OOPSLA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Allen, J. Bannet, and R. Cartwright. Mixins in Generic Java are sound. Technical report, Rice University, 2003.Google ScholarGoogle Scholar
  3. E. Allen and R. Cartwright. Safe instantiation in Generic Java. In PPPJ '04, pages 61--66, 2004. Available at http://www.cs.rice.edu/CS/PLT/Publications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. E. Allen, R. Cartwright, and B. Stoler. Efficient implementation of run-time generic types for Java. In IFIP WG2.1 Working Conference on Generic Programming, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Ancona, G. Lagorio, and E. Zucca. Smart modules for Java-like languages. In 7th Intl. Workshop on Formal Techniques for Java-like Programs, 2005.Google ScholarGoogle Scholar
  6. D. Ancona and E. Zucca. True modules for java classes. In ECOOP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Bracha. The Programming Language Jigsaw: Mixins, Modularity, and Multiple Inheritance. PhD thesis, University of Utah, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In OOPSLA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Cartwright and G. L. Steele, Jr. Compatible genericity with run-time types for the Java programming language. In OOPSLA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. K. Crary, R. Harper, and S. Puri. What is a recursive module? In PLDI, pages 50--63, New York, NY, USA, 1999. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Dreyer. Understanding and Evolving the ML Module System. PhD thesis, Carnegie Mellon University, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Flatt and M. Felleisen. Units: Cool modules for HOT languages. In SIGPLAN, pages 236--248, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Flatt, S. Krishnamurthi, and M. Felleisen. A programmer's reduction semantics for classes and mixins. In Formal Syntax and Semantics of Java, pages 241--269, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In OOPSLA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. X. Leroy. The Objective Caml system: Documentation and user's manual., 2004. http://caml.inria.fr/pub/ docs/manual-ocaml/.Google ScholarGoogle Scholar
  16. S. McDirmid, M. Flatt, and W. Hsieh. Jiazzi: New age components for old fashioned Java. In OOPSLA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Microsystems. JSR 14: Adding generic types to the Java Programming Language, 2001.Google ScholarGoogle Scholar
  18. S. Microsystems. JSR 277: Java Module System, 2005.Google ScholarGoogle Scholar
  19. S. Microsystems. The Fortress language specification, Sept 2006.Google ScholarGoogle Scholar
  20. S. Microsystems. JSR 294: Improved Modularity Support in the Java Programming Language, 2006.Google ScholarGoogle Scholar
  21. R. Milner, M. Tofte, and D. Macqueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Myers, J. Bank, and B. Liskov. Parameterized types for Java. In POPL, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Odersky. Programming in Scala, 2006. Draft.Google ScholarGoogle Scholar
  24. M. Odersky and M. Zenger. Scalable component abstractions. In OOPSLA, pages 41--57, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Owens and M. Flatt. From structures and functors to modules and units. In ICFP, volume 41, pages 87--98, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. V. Russo. Recursive structures for standard ML. In ICFP, pages 50--61, New York, NY, USA, 2001. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Sasitorn and R. Cartwright. Efficient first-class generics on stock Java virtual machines. In SAC, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Sasitorn and R. Cartwright. Deriving compnents from genericity. In SAC, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Sasitorn and R. Cartwright. The soundness of Component NextGen. Technical report, Rice University, 2007. http://www.cs.rice.edu/~javaplt/papers/.Google ScholarGoogle Scholar
  30. C. Szyperski. Component Software. Addison-Wesley, 1998.Google ScholarGoogle Scholar
  31. C. A. Szyperski. Import is not inheritance: Why we need both: modules and classes. In O. L. Madsen, editor, ECOOP, volume 615, pages 19--32, Berlin, Heidelberg, New York, Tokyo, 1992. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Viroli. Parametric polymorphism in Java: an efficient implementation for parametric methods. In SAC, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. Viroli and A. Natali. Parametric polymorphism in Java: an approach to translation based on reflective features. ACM SIGPLAN Notices, 35(10):146--165, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Component nextgen: a sound and expressive component framework for java

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!