Standing in the Field
Notes from SJS Application Server Field Engineering
One of the things that we are struggling with at blogs.sun.com is how to deal with source code. Putting a code sample on blogs.sun.com is technically considered by the US government to be exporting software. Which is subject to restriction by a considerable number of export laws.
So, in theory, this means that every single time someone wants to publish a "Hello World" example it should be cleared by Sun's legal department as export regulation compliant before it gets posted. Sun's legal department is working on a way to streamline this process, but in the meantime I'm playing it safe and not publishing code.
This is my long and convoluted excuse about why I haven't published my annotations presentation here. I originally wrote this presentation for the Harrisburg Java User's Group because I couldn't find any good examples for the advanced use of Java 5.0 annotations (aka metadata). There were lots of examples on the web of how to use the new builtin annotations and even how to make your own annotation types and parse them with reflection.
But when it came to doing advanced things, like modifying the behavior the compiler to autogenerate code and supporting files, I couldn't find anything on the web other than the apt tool documentation. But, to me, this was the important part of annotations: the ability to create declarative behavior. So I did a little experimentation and built some sample applications that demonstrated the power of annotations. My favorite (and largest) sample was using annotations to automatically build a factory pattern in front of any class with just a simple annotation. The apt tool would automatically generate and compile the factory front end. The actual generated code was pretty simplistic, but I was excited by the potential.
But if I stripped out the code examples from my presentation, there isn't much of a presentation left. So, despite wanting to put that content up here, I'm going to wait until the lawyers get their act straight. In the meantime, you check out the apt documentation yourself:
Update: A couple of Sun blogging gurus read this post and have emailed me. Perhaps the legal team is further along in their streamlining that I had thought. I may be able to post the code after all. Stay tuned.
(2004-11-01 07:43:13.0) Permalink Comments [1]| « November 2004 » | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
2 | 3 | 4 | 5 | 6 | ||
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
29 | ||||||
| Today | ||||||