views:

321

answers:

2

I came accross the xdoclet project and see it enjoys/ed high popularity. So the question is, now that we have annotations in java: is xdoclet legacy?

Or is there something to xdoclet I didn't see/understand.

+5  A: 

XDoclet is an annotation implementation via JavaDoc. Anything that could be done with XDoclet (and much more) can be done with JDK5+ annotations.

One obvious difference however is that XDoclet is non-invasive. That is, it doesn't require you to import classes into your own code. If you are using 3rd-party Java annotations in your own code, then of course you cannot build your code without the 3rd party jars present. This is not a drawback that XDoclet suffers from. (You may not see it as a drawback at all.)

Of course, even though XDoclet may be legacy, I suspect that for most projects which have relied heavily on it, there will be no rush to migrate to using annotations (maxim: if it ain't broke, don't fix it).

oxbow_lakes
Based on the above, is it best not to spend time learning xDoclet and concentrate on learning annotation provided by JDK5+ and other tools like Hibernate annotation?
boyd4715
+1  A: 

Hopefully XDoclet is history. As has been pointed out, you need to include some kind of artifact from the provider of the annotation, usually some kind of api module. This only enforces the strong typing aspects that we're so used to in java, allowing all sorts of of automated tracking/tracing and proper tool support in all modern ide's.

krosenvold