Bruce Chapman will give a quick introduction to annotations and annotation processing in the Java Programming Language, then preview his JavaOne "Birds of a Feather" session "Compile Time Assertions: Enforcing Extralinguistic Constraints" followed by Q and A.

Bruce Chapman has been programming with Java since 1998 and is a member of the JSR-269 (Pluggable Annotation Processing API) expert group.

Presentation Details

Title: Compile Time Assertions: Enforcing Extralinguistic Constraints

Abstract: The Java Language Specification defines many constraints on what can constitute a valid program. These are linguistic constraints, because they are defined by the language.

Extralinguistic constraints also define limits to what can constitute a valid program, but these cannot be expressed in the Java programming language. They are normally expressed in the natural language of the documentation. Two examples are:

"The method must be declared public and static, it must not return any value, and it must accept a String array as a parameter. The method declaration must look like the following:

public static void main(String args[]) "

-from the "java" tool documentation and

"The subtype may assume this responsibility only if the class it extends has an accessible no-arg constructor to initialize the class's state. It is an error to declare a class Serializable if this is not the case. The error will be detected at runtime."

- from javadoc.

When such constraints are not met, programs compile successfully (because they meet the linguistic constraints, which are the only ones the compiler enforces) yet still fail at runtime.

This presentation identifies the root cause of these failures and shows how a combination of JDK 6.0 release features can be used to implement a "compile time assertion" facility enabling many of these kinds of failure to be detected at compile time.

May 3rd, 2006

5.00pm for 5:15-6:30pm

Wanaka Room
Level 6, NEC House
Corner Taranaki and Manners Sts.

In what is becoming a fine tradition, after this talk we intend to repair to a pub for some light R&R. All who would like to discuss points raised during the talk in a more congenial atmosphere are welcome!

Valid XHTML 1.1