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.
- E. Allen, J. Bannet, and R. Cartwright. First-class genericity for Java. In OOPSLA, 2003. Google Scholar
Digital Library
- E. Allen, J. Bannet, and R. Cartwright. Mixins in Generic Java are sound. Technical report, Rice University, 2003.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- D. Ancona and E. Zucca. True modules for java classes. In ECOOP, 2001. Google Scholar
Digital Library
- G. Bracha. The Programming Language Jigsaw: Mixins, Modularity, and Multiple Inheritance. PhD thesis, University of Utah, 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Cartwright and G. L. Steele, Jr. Compatible genericity with run-time types for the Java programming language. In OOPSLA, 1998. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Dreyer. Understanding and Evolving the ML Module System. PhD thesis, Carnegie Mellon University, 2005. Google Scholar
Digital Library
- M. Flatt and M. Felleisen. Units: Cool modules for HOT languages. In SIGPLAN, pages 236--248, 1998. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In OOPSLA, 1999. Google Scholar
Digital Library
- X. Leroy. The Objective Caml system: Documentation and user's manual., 2004. http://caml.inria.fr/pub/ docs/manual-ocaml/.Google Scholar
- S. McDirmid, M. Flatt, and W. Hsieh. Jiazzi: New age components for old fashioned Java. In OOPSLA, 2001. Google Scholar
Digital Library
- S. Microsystems. JSR 14: Adding generic types to the Java Programming Language, 2001.Google Scholar
- S. Microsystems. JSR 277: Java Module System, 2005.Google Scholar
- S. Microsystems. The Fortress language specification, Sept 2006.Google Scholar
- S. Microsystems. JSR 294: Improved Modularity Support in the Java Programming Language, 2006.Google Scholar
- R. Milner, M. Tofte, and D. Macqueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997. Google Scholar
Digital Library
- A. Myers, J. Bank, and B. Liskov. Parameterized types for Java. In POPL, 1997. Google Scholar
Digital Library
- M. Odersky. Programming in Scala, 2006. Draft.Google Scholar
- M. Odersky and M. Zenger. Scalable component abstractions. In OOPSLA, pages 41--57, New York, NY, USA, 2005. ACM Press. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- C. V. Russo. Recursive structures for standard ML. In ICFP, pages 50--61, New York, NY, USA, 2001. ACM Press. Google Scholar
Digital Library
- J. Sasitorn and R. Cartwright. Efficient first-class generics on stock Java virtual machines. In SAC, 2006. Google Scholar
Digital Library
- J. Sasitorn and R. Cartwright. Deriving compnents from genericity. In SAC, 2007. Google Scholar
Digital Library
- J. Sasitorn and R. Cartwright. The soundness of Component NextGen. Technical report, Rice University, 2007. http://www.cs.rice.edu/~javaplt/papers/.Google Scholar
- C. Szyperski. Component Software. Addison-Wesley, 1998.Google Scholar
- 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 Scholar
Digital Library
- M. Viroli. Parametric polymorphism in Java: an efficient implementation for parametric methods. In SAC, 2001. Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Component nextgen: a sound and expressive component framework for java
Recommendations
Component nextgen: a sound and expressive component framework for java
OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applicationsDeveloping 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 ...
Deriving components from genericity
SAC '07: Proceedings of the 2007 ACM symposium on Applied computingThere is a growing recognition that programming platforms should support the decomposition of programs into components: independent units of compiled code that are explicitly "linked" to form complete programs. This paper describes how to formulate a ...
Efficient first-class generics on stock Java virtual machines
SAC '06: Proceedings of the 2006 ACM symposium on Applied computingThe second-class formulation of generics in Java 5.0 discards generic type information during compilation. As a result, Java 5.0 prohibits run-time type-dependent operations, generates unavoidable unchecked warnings (type errors) during compilation, and ...







Comments