Browsing by Author "Sasitorn, James"
Now showing 1 - 2 of 2
Results Per Page
Sort Options
Item Component NextGen: A sound and expressive component framework for Java(2007) Sasitorn, James; Cartwright, Robert S.Java has transformed mainstream software development by supporting clean object-oriented design, comprehensive static type checking, safe program execution, and an unprecedented degree of portability. Despite these significant achievements, the Java language has been handicapped as a vehicle for writing large applications by the absence of a component system for decomposing applications into independent units with statically checked interfaces. Developing a general component system for an object-oriented language, such as Java, is a challenging design problem because inheritance across component boundaries can cause accidental method overrides. In addition, 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. This thesis discusses how a component framework can be constructed for a nominally typed object-oriented language supporting first-class generic types simply by adding appropriate annotations and syntactic sugar. 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 N EXTGEN (CGEN). CGEN, which is based on the Sun Java 5.0 javac compiler, is backwards compatible with existing Java binary code and generates code that can be executed on current Java Virtual Machines.Item Efficient implementation of first-class polymorphic methods in Java(2005) Sasitorn, James; Cartwright, Robert S.This thesis describes a new implementation architecture for polymorphic methods in Generic Java using the NEXTGEN compiler framework. The standard Generic Java (Java 1.5) compiler erases generic types at compilation. This transformation prohibits type-dependent operations, limiting generic expressivity. Type erasure causes unchecked warnings at compilation, and unexpected behavior or exceptions at runtime. Alternative reflection-based implementations of Generic Java support type-dependent operations at the cost of significant execution overhead. In contrast, this work presents an efficient implementation of polymorphic methods using NEXTG EN. An extended NEXTGEN compiler generates snippet environment template classes to encode type-dependent operations for polymorphic methods. A customized class-loader generates specialized template instantiations on demand. This demand-driven code specialization provides an efficient mechanism to propagate runtime type information, while maintaining backwards compatibility with existing libraries and Java Virtual Machines. Benchmarks show runtime support for polymorphic methods in NEXTG EN outperforms reflection-based approaches, with runtime overhead comparable to erasure-based Generic Java.