Best Practice for JavaDocs - Interface,Implementation, or Both?
java
Solution
In my project, Eclipse automatically creates documentation as below :
/* (non-Javadoc)
* @see com.comp.SomeInterface#method(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public void method(HttpServletRequest arg0, HttpServletResponse arg1)
throws Exception {
// TODO Auto-generated method stub
}
We have created javadoc using Ant task, so it creates link to the interface.
Problem
I have a DAO interface and implementation of the DAO. The JavaDocs in the interface are what Netbeans displays to the client implementing the DAO methods. Obviously I will need to maintain the JavaDocs in the interface. But what about the implementation of it? On one hand, it is convenient to have them there, but on the other hand, it is duplication, and requires them to be maintained in two places. Just wondering what other Java developers do.