Now that we have annotations in java, is xdoclet legacy?

后端 未结 2 458
误落风尘
误落风尘 2021-01-03 14:08

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 som

相关标签:
2条回答
  • 2021-01-03 14:27

    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.

    0 讨论(0)
  • 2021-01-03 14:34

    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).

    0 讨论(0)
提交回复
热议问题