Abstract | ||
---|---|---|
cJ is an extension of Java that allows supertypes, fields, and methods of a class or interface to be provided only under some static subtyping condition. For instance, a cJ generic class, C, may provide a member method m only when the type provided for parameter P is a subtype of a specific type Q.From a practical standpoint, cJ adds to generic Java classes and interfaces the ability to express case-specific code. Unlike conditional compilation techniques (e.g., the C/C++ "#ifdef" construct) cJ is statically type safe and maintains the modular type-checking properties of Java generic classes: a cJ generic class can be checked independently of the code that uses it. Just like regular Java, checking a cJ class implies that all uses are safe, under the contract for type parameters specified in the class's signature.As a specific application, cJ addresses the well-known shortcomings of the Java Collections Framework (JCF). JCF data structures often throw run-time errors when an "optional" method is called upon an object that does not support it. Within the constraints of standard Java, the authors of the JCF had to either sacrifice static type safety or suffer a combinatorial explosion of the number of types involved. cJ avoids both problems, maintaining both static safety and conciseness. |
Year | DOI | Venue |
---|---|---|
2007 | 10.1145/1218563.1218584 | AOSD |
Keywords | Field | DocType |
regular java,specific type,safe type condition,generic java class,cj avoids,cj generic class,static type safety,java generic class,java collections framework,cj class,standard java,meta programming,aspect oriented programming,type safety | Metaprogramming,Data structure,Scala,Programming language,Java collections framework,Computer science,Generics in Java,Conditional compilation,Type safety,Java | Conference |
ISBN | Citations | PageRank |
1-59593-615-7 | 19 | 1.00 |
References | Authors | |
17 | 3 |
Name | Order | Citations | PageRank |
---|---|---|---|
Shan Shan Huang | 1 | 202 | 14.60 |
David Zook | 2 | 88 | 6.24 |
Yannis Smaragdakis | 3 | 2247 | 147.50 |