Annotations complement javadoc tags

Why is it said that annotations complement javadoc tags?

+2


source to share


2 answers


One possible reason is that the use of annotations can overlap with the use of Javadoc tags.

The best example is, of course, the @deprecated

Javadoc tag and annotation @deprecated

, which both indicate the same thing.



Both annotations and Javadoc tags provide metadata about code elements.

+4


source


Annotations are code and will be represented at the byte code level. Javadoc tags are document-level artifacts and metadata for the javadoc processor.

If the storage layer of the annotation class is runtime, you can mirror the class and access the annotation; there is no such possibility for the javadoc tag (unless you have access to the source files and parsing them).



So in a very narrow sense (like a javadoc processor that processes bytecode, like generating code), tags can be considered "complementary" [sic] for annotations, but that's about it.

All in all, this is a bad meme to wear in your head as it doesn't really communicate the true difference between these two completely different designs.

+5


source







All Articles