ANNOTATION-BASED VALUE OBJECT CODE GENERATORS
There is a well-established design pattern for value objects. Josh Bloch has set this out well in his Effective Java book. And this design pattern is well suited to implementing self-validated domain objects that are (relatively) trivial to persist to databases using EJB 3 O-R mapping tools such as Hibernate. It also can work well with XML-Java mapping tools like Apache XMLBeans or JAXB (JSR 222).
But coding value objects is a pain. You need to implement a lot of boilerplate code that is easily capable of automation.
This session will show you how to use Java 5 annotations to build a code generator that does this. There is a lot that needs to be done, including differentiating between design idioms for immutable data and idioms for mutable data. This session will describe how to use annotations, reflection APIs, and tools like APT (the Java 5 annotation-processing tool) or its successor (JSR 269, hopefully being implemented in Mustang) to make writing such code generators easy.
It's dumb to write boilerplate code. Annotations make automated code generation potentially easy. This session will show you how. It will also show how Java 5 generics and enumerations can be used to provide powerful instance validation.
Note: What I'm talking about here will be forthcoming in a book to be available by JavaOne 2006. Come and find out early! Code is available now.