Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Documenting

Thread view: 
VisionSet - 31 Jan 2006 22:47 GMT
I'm used to seeing and have adopted the javadoc style overtime so as to
document my packages/classes/methods from a responsibilities and contract
stand point.  This makes total sense for the client programmer using library
code.  However if you aren't writing library code and your main concern is
maintenance by yourself or whoever it seems to me that comments such as
'this method is known/written to be called by foo for reason x' have a
place.

Anyone any comments concerning this or can point to me examples of
documentation that exists for mainly maintenance purposes?

I realise that this is where sequence diagrams come it to there own.

TIA
--
Mike W
Chris Uppal - 01 Feb 2006 08:54 GMT
> However if you aren't writing library code and your main
> concern is maintenance by yourself or whoever it seems to me that
> comments such as 'this method is known/written to be called by foo for
> reason x' have a place.

I may be reading too much into the specific example you have chosen, but I'd
say that for most purposes documenting where a method is called from, or where
a class is used, is counter-productive.  If your support tools are any good at
all, then finding that kind of browsing information is easy.

Not that there aren't cases where the control-flow (or similar) is complicated
and requires explication, but I wouldn't expect that to be the typical case.
If it is required, then I'd either put it in the JavaDoc or in "normal"
comments, depending on who the JavaDoc is intended to be read by.

And, of course, there's always a need for comments intended only for the person
reading the code.  Some people claim that well-written code is it's own
commentary (and I agree); some go on to claim that well-written code is all the
commentary that is needed -- they are deluding themselves.

   -- chris
VisionSet - 01 Feb 2006 10:17 GMT
> If your support tools are any good at
> all, then finding that kind of browsing information is easy.

Yes, I should assume these are available since they are more powerful than
any snapshot comment I may make.
I'll not stray from the conventions.
Thanks all.

--
Mike W
Ed - 01 Feb 2006 11:51 GMT
VisionSet skrev:

> I'm used to seeing and have adopted the javadoc style overtime so as to
> document my packages/classes/methods from a responsibilities and contract
[quoted text clipped - 12 lines]
> --
> Mike W

The advice given so far about being cautious of describing the type of
comment you suggest seems wise; this type, however, could be seen as
simple implementation comments, and as such Sun's style guidelines
recommend that these comments be placed after the class/method
declaration:

(From
http://java.sun.com/docs/codeconv/html/CodeConventions.doc4.html#16838)

"If you need to give information about a class, interface, variable, or
method that isn't appropriate for documentation, use an implementation
block comment (see section 5.1.1) or single-line (see section 5.1.2)
comment immediately after the declaration. For example, details about
the implementation of a class should go in in such an implementation
block comment following the class statement, not in the class doc
comment."

Yes, it's just a convention, and yes, they do take sides in the
open-curly-bracket-placement war which is enough to have some
programmers burning the convention in the streets, but ...

.ed

--
www.EdmundKirwan.com - Home of The Fractal Class Composition.
Monique Y. Mudama - 01 Feb 2006 16:56 GMT
> The advice given so far about being cautious of describing the type
> of comment you suggest seems wise; this type, however, could be seen
[quoted text clipped - 12 lines]
> such an implementation block comment following the class statement,
> not in the class doc comment."

Hey, neat!  It turns out I've been following the Sun style guidelines
and didn't even know it!

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.