Java 5 Annotations are allowing some people to Think Different. No-one knows exactly what innovations will come along yet. Amotz Anner has written about Mapping Objects to XML Files using Java 5 Annotations, and shows us how to do so in code.
- Posted by: Heinz Kabutz
- Posted on: October 17 2004 18:35 EDT
It took me a while to understand this code, and it will take me even longer to appreciate the full implication of annotations. However, Amotz does a very nice job of showing by a practical example how annotations could be used.
Read Mapping Objects to XML Files using Java 5 Annotations, in issue 97 of The Java Specialists' Newsletter
I find this article extremely interesting because I take the same tact with my use of XML. Much of my initial software experience has revolved around building document-centric content systems. Most recently I used Reflections to implement an XML declarative language that i defined for the workflow mappings from HTTP requests to an independent service layer.
It worked very well, but from the beginning I was wary about using Reflection to connect the two. The declarative model with the dynamic generation was great for defining strict rules about what could and could not be done in the web space, thus maintaining a more strict layering of the code, but i was planning on implementing an actual compiler for the xml, to build java interfaces, similar to the way that the xjcompiler works. Perhaps moving to 1.5 will be a sooner step than i anticipated!
Great article, i will sure to keep up with them!
What am I missing here? What does this add over JAXB (apart from potentially avoiding a few JAXB bugs)?