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

元气小坏坏 提交于 2019-11-30 16:11:17

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!