0

For example, if i have MyObject with fields SomeThing getFieldOne() SomeThing getFieldTwo() whatever, it is obvious, that while javadocking getFieldOne() and getFieldTwo() , i write there an info about the fields of MyObject retuned.

But what to do, if sime fields are not in MyObject directly via getters avaible, but i must call a static adapter like: ObjectContainer.getFieldThree(myObject) ?

The info about the fieldTree is logically related to MyObject, howewer it is no getter method there by design( do not ask me why, i have not designed it , i just want to determine the best way to comment that).

2
  • Use an @see or @link? Or explain exactly what you want to see in the javadoc. Commented May 13, 2016 at 12:40
  • Yes good hint with links. I could use those links to ObjectContainer JavaDoc from MyObject Javadoc. <br> I want let a user, reading a JavaDoc about MyObject, know, that there exist a fieldTree, what is logically related to MyObject, and to get it, you must call ObjectContainer.getFieldThree(myObject) Commented May 13, 2016 at 12:51

1 Answer 1

0

In a scenario like this, SomeThing does not necessarily have a dependency on ObjectContainer, and thus shouldn't know about the logic or interface of this other class. For this reason, it should not be part of SomeThing's JavaDoc.

I would create a separate JavaDoc for ObjectContainer, explaining the functionality, and in addition to that, create a separate how-to guide on how to use the two classes and other relevant ones in combination, referring to the JavaDoc. This could have a 'cookbook' style, as it is common for many libraries or frameworks, explaining certain use cases and scenarios.

Sign up to request clarification or add additional context in comments.

1 Comment

Again: I want let a user, reading a JavaDoc about MyObject, know, that there exist a fieldTree, what is logically related to MyObject, and to get it, you must call ObjectContainer.getFieldThree(myObject)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.