This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Javadoc Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Javadoc Query" Watch "Javadoc Query" New topic
Author

Javadoc Query

Phil Harron
Greenhorn

Joined: Jun 21, 2002
Posts: 29
Hi guys, I'm just doing my Javadoc now for the UrlyBird 1.3.1 and was wondering should I write javadoc for every private method and field for each class?

The Spec says ...javadoc must be used for each element of the public interface..

Thanks
Phil


SCJP 1.4<br />SCJD (Ongoing)
Eben Hewitt
Author
Ranch Hand

Joined: Apr 16, 2004
Posts: 36
I know developers who passed with only writing comments for the public methods and constructors, when given the same instructions. So I would imagine that that would be okay.

I wrote Javadoc for private helper methods if their purpose or relation to the rest of the class wasn't immediately self-evident. But that was more for me, in case I wanted to refer to it later.

Eben


Eben Hewitt. SCJP, SCWCD, SCJD, SCJWSD for JEE 5, TOGAF 8 Certified Architect, author of Java SOA Cookbook (O'Reilly, 2009) and contributor to 97 Things Every Software Architect Should Know
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Phil:
I believe javadoc is not required for private methods and fields, however it is good programming practice to document everything. It will make life much easier for whoever going to maintain your code.


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
IN TERMS OF THE EXAM, It's probably helpful to document private methods because the concept is that the product will be passed along to junior developers. At least, that's the way it is on B&S.

RK


SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
Ben Ritchie
Ranch Hand

Joined: Nov 18, 2002
Posts: 98
I wrote javadoc for everything - although writing it was really boring


SCJP1.4, SCJD, SCEA (in progress)
Jon Entwistle
Ranch Hand

Joined: Feb 20, 2003
Posts: 118
I played it safe and documented everything and enjoyed every second of it :roll:

Jon
[ July 22, 2004: Message edited by: Jon Entwistle ]

SCJD, SCEA
Matt Pryor
Greenhorn

Joined: Jul 21, 2004
Posts: 2
Another thing to bear in mind is that javadoccing up your code towards the end of the project lifecycle can be a really, really good way of refreshing your memory on how everything works and fits together!

Particularly if you do the assignment over a longish period of time.

[edited for spelling]
[ July 23, 2004: Message edited by: Matt Pryor ]

===========<br /> <br />SCJP (89%)<br />SCJD Pending
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javadoc Query
 
Similar Threads
Open firefox window and redirect to a url
Accessing of character by character from a String...
How does servlet decide which init method to call
RequestDispatcher
IP address regular expression