Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc for project documentation [closed]

I want to document a Java project I'm working on. In the past I've typically documented the design and software API in a wiki. However, after recently using Mockito for mocking tests, I was impressed at the amount and quality of project-level documentation in the actual javadocs.

My question is, do people typically use Javadocs for documenting the higher level view of the project (e.g. architecture, design decisions etc), or is this kind of information best documented in (say) a wiki?

like image 781
Martin Avatar asked Jun 23 '11 19:06

Martin


People also ask

Do you write Javadoc for private methods?

Nope, you shouldn't write javadoc for private methods. End users don't have access to private fields or methods so there really isn't a point in providing javadoc for them. Private fields and methods are only meant for the developer. If you really need to though, feel free to write comments for non-obvious logic.

Do protected methods need Javadoc?

All public and protected methods should be fully defined with Javadoc. Package and private methods do not have to be, but may benefit from it.

How do I create an automatic Javadoc?

In the Package Explorer view, select a Java project and click Project > Generate Javadoc with Diagrams > Automatically. In the Generate Javadoc wizard, under Javadoc command, select the Javadoc command (an executable file).

Should Javadoc have periods?

javadoc uses the first "sentence" of a doc comment as a summary sentence. It assumes that a period followed by a space, tab, or line terminator ends the sentence.


1 Answers

It depends on who your audience is.

If your audience is going to be primarily using the API, it is generally better to invest in clear concise descriptions (with examples) in your Javadoc. If the audience is likely to never see the API, then it is better to maintain your documentation outside of Javadoc. This is primary a function of how the documentation is navigated; Javadoc navigation facilitates the programming process.

As for whether you wish to put the documentation in a wiki or in a PDF, again it depends on the audience. If the only reason for wiki is to have a web facing HTML representation of the documentation, using something similar to Docbook might provide such documentation with the added benefit of ability to generate PDF representations of the same documentation. If you really have an active community, wiki shines in the ability of allowing near-strangers to modify your documentation.

Determine if the strengths of the products align with your needs, and if they do, then it's the right choice.

like image 53
Edwin Buck Avatar answered Oct 16 '22 05:10

Edwin Buck