Best practices for JavaDocs – interface, implementation, or both?

I have a Dao interface and Dao implementation JavaDocs in the interface is the content displayed by NetBeans to clients implementing Dao methods

Obviously, I need to maintain JavaDocs in the interface But what about its implementation? On the one hand, it's convenient to put them there, but on the other hand, it's repetitive and needs to be kept in two places

Just want to know what other Java developers have done

Solution

In my project, eclipse automatically creates documents as follows:

/* (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 created the Javadoc using the ant task, so it created a link to the interface

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>