Comment the interface, implementation or both?

As a general rule, I use the same DRY (Don’t Repeat Yourself) principle as with code:

  • on interface, document the interface
  • on implementation, document the implementation specifics

Java specific: when documenting the implementation, use {@inheritDoc} tag to “include” javadocs from the interface.

For more information:

  • Official javadoc documentation
  • Some unofficial advice.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)